Re: [GENERAL] Query optimizer & prepared statements

2009-06-23 Thread Chris
Jack Orenstein wrote: If x is an integer column with an index, then select ... from T where x > 1 and select ... from T where x > 10 could be optimized differently. So how is optimization done for a prepared statement containing a variable, e.g. select .

Re: [GENERAL] Query optimizer & prepared statements

2009-06-23 Thread Emanuel Calvo Franco
> >    select ... >    from T >    where x > $1 > prepare testy_prepare(int) as select * from T where x = $1; execute testy_prepare(4); Follow the docs :) http://www.postgresql.org/docs/8.1/interactive/sql-prepare.html -- Emanuel Calvo Franco ArPUG [www.arpug.com.ar] / AOSUG Mem

[GENERAL] Query optimizer & prepared statements

2009-06-23 Thread Jack Orenstein
If x is an integer column with an index, then select ... from T where x > 1 and select ... from T where x > 10 could be optimized differently. So how is optimization done for a prepared statement containing a variable, e.g. select ... from T where