Re: SQL Query Optimization - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SQL Query Optimization
Date
Msg-id 11799.1019140689@sss.pgh.pa.us
Whole thread Raw
In response to SQL Query Optimization  (Dav Coleman <dav@serve.com>)
List pgsql-hackers
Dav Coleman <dav@serve.com> writes:
> I have noticed that the semantically equivalent SQL queries can
> differ
> vastly in speed performance depending on the order of clauses ANDed
> together ( "WHERE cond1 AND cond2" takes forever, but  "WHERE cond2
> AND cond1" comes right back).

Could we see a specific example?

It would also be useful to know what PG version you are using, whether
you've VACUUM ANALYZEd the tables, and what EXPLAIN has to say about
your query.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Michael Loftis
Date:
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE
Next
From: Michael Loftis
Date:
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE