Re: [SQL] [GENERAL] Query analyse

2003-07-25 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > You're probably ending up with different plans since in one case it has > a plain column reference and in the other it has a marginally complicated > expression in the join condition. Yeah. 7.3 and before cannot do merge or hash joins on conditions that

Re: [SQL] [GENERAL] Query analyse

2003-07-25 Thread Dmitry Tkach
The first query is able to use the index on nr_proponente, because the condition involves that column directly, the second query is not, because the index only contains the values of nt_proponente, not results of trunc(..)/ Try replacing that condition with something like pa.nr_proponente B

Re: [SQL] [GENERAL] Query analyse

2003-07-25 Thread Stephan Szabo
On Fri, 25 Jul 2003, Elielson Fontanezi wrote: > First of all, my envoronment is: > Linux netlab142.prodam 2.4.8-26mdk #1 Sun Sep 23 17:06:39 CEST 2001 > i686 unknown > pg_ctl (PostgreSQL) 7.2.1 > > I would like some suggestions on how to speed up a query. > > Both of t