Re: 3-table query optimization

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

 



Michal Taborsky - Internet Mall <michal.taborsky@xxxxxxx> writes:
> SELECT product.product_id
>    FROM action
>    JOIN product ON (product.product_id=action.product_id)
>   WHERE action.shop_group_id=1
>     AND EXISTS (SELECT 1
>           FROM catalog.product_program
>           WHERE product_id=product.product_id
>             AND product_program.program_id =1104322
>     )

Try converting the EXISTS subquery to an IN.

			regards, tom lane


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

  Powered by Linux