Re: A query become very slow after upgrade from 8.1.10 to 8.4.5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yaocl <chunlinyao@xxxxxxxxx> writes:
> SELECT t_a.id FROM t_a
> WHERE EXISTS ( SELECT t_b.id FROM t_b, t_c
>                WHERE t_b.id = t_a.id AND t_c.flag = 'f')

I have some hopes for fixing this in 9.1, but nothing is going to happen
in 8.4 or 9.0.  In the meantime, is it intentional that there is no join
clause between t_b and t_c?  That'd be a lot more efficient as two
separate EXISTS tests, ie

WHERE EXISTS ( SELECT 1 FROM t_b WHERE t_b.id = t_a.id ) AND
      EXISTS ( SELECT 1 FROM t_c WHERE t_c.flag = 'f')

but I wonder whether this query doesn't simply reflect a logic error on
the client side.

			regards, tom lane

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux