Re: SQL Query Optimization

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dav Coleman <dav(at)serve(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SQL Query Optimization
Date: 2002-04-18 14:38:09
Message-ID: 11799.1019140689@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dav Coleman <dav(at)serve(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Loftis 2002-04-18 14:43:21 Re: Index Scans become Seq Scans after VACUUM ANALYSE
Previous Message Larry Rosenman 2002-04-18 14:38:06 Re: [HACKERS] build of 7.2.1 on SCO Openserver and