Re: Very slow query - why?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Schilling <rschi(at)rsmba(dot)biz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Very slow query - why?
Date: 2004-02-02 14:53:50
Message-ID: 9221.1075733630@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Schilling <rschi(at)rsmba(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-02-02 14:56:21 Re: Array in stored procedure
Previous Message Terry Lee Tucker 2004-02-02 14:36:00 Return Value of a Function