Re: slow sub-query problem

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: slow sub-query problem
Date: 2014-11-17 18:44:46
Message-ID: 1416249886486-5827275.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tim Dudgeon wrote
> All relevant columns are indexed and using PostgreSQL 9.4.
> Any clues how to re-write it to avoid the slow sub-query.

Try using an actual join instead of a subquery. You will have to provide
aliases and then setup the where clause appropriately.

I am reading the query correctly in that the repeated reference to 643413 is
redundant? The lack of a defined natural primary key makes blind reasoning
difficult.

David J.

--
View this message in context: http://postgresql.nabble.com/slow-sub-query-problem-tp5827273p5827275.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David Johnston 2014-11-17 19:19:49 Re: slow sub-query problem
Previous Message Tim Dudgeon 2014-11-17 18:34:34 slow sub-query problem