Re: Very slow query - why? - Mailing list pgsql-general

From Tom Lane
Subject Re: Very slow query - why?
Date
Msg-id 9221.1075733630@sss.pgh.pa.us
Whole thread Raw
In response to Re: Very slow query - why?  (Richard Schilling <rschi@rsmba.biz>)
List pgsql-general
Richard Schilling <rschi@rsmba.biz> writes:
> Looking at your query, I notice that the longer query happens when you
> search on b.zcustnum=30538 while the LEFT OUTER JOIN remains the same.
> It could be that when testing a.zcustnum=30530 the server can short
> circuit the logic - it only has to check a.zcustnum to see if the
> entire tuple should be selected.

Also note that the planner has gotten successively smarter about outer
joins in each of the past several releases.  Without knowing which PG
version this is (and it ain't "PostgreSQL 4.3" as alleged in the OP's
message...), and without seeing EXPLAIN ANALYZE results, it's hard to
speculate about what's going on.

            regards, tom lane

pgsql-general by date:

Previous
From: Terry Lee Tucker
Date:
Subject: Return Value of a Function
Next
From: Tom Lane
Date:
Subject: Re: Array in stored procedure