Re: faster SELECT - Mailing list pgsql-general

From NTPT
Subject Re: faster SELECT
Date
Msg-id 010c01c404fb$03b4cee0$d300a8c0@webpropag.cz
Whole thread Raw
In response to faster SELECT  (sferriol <sylvain.ferriol@imag.fr>)
List pgsql-general
----- Původní zpráva -----
Od: "sferriol" <sylvain.ferriol@imag.fr>
Komu: <pgsql-general@postgresql.org>
Odesláno: 8. března 2004 10:41
Předmět: [GENERAL] faster SELECT


> hello
> in a 'SELECT', does postgres read the 'WHERE' condition from left to right.
>
> for example
> 1) select ... where a and b;
> 2) select ... where b and a;
>
> 1 and 2 will use the same cpu time or not ?
>
> sylvain


First should be used  the most RESTRICTIVE condition. ie if  condition "a" limit output to few rows from many , it
shouldbe used first in WHERE . Preferrable condition "a"  should be created  index aware, so relatively inexpensive
indexscan can  eliminate most of unwanted lines from output.  Following this rule should you should be able to create a
fastestand low cost query. 

So it can not be  explicitely told if 1 and 2 will use the sme cpu time in real life


pgsql-general by date:

Previous
From: Chris
Date:
Subject: Re: faster SELECT
Next
From: Andrew Rawnsley
Date:
Subject: Re: faster SELECT