Re: Multiple-Table-Spanning Joins with ORs in WHERE Clause

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

 



On Thu, Sep 22, 2016 at 6:37 AM, Madusudanan.B.N <b.n.madusudanan@xxxxxxxxx> wrote:
> However, this results in an awful slow plan (requiring to scan the complete big_table which obviously isn't optimal)

You mean to say there is a sequential scan ? An explain would be helpful. Are there indexes on the provided where clauses. 

Postgres can do a Bitmap heap scan to combine indexes, there is no need to fire two separate queries.

It can't combine bitmap scans that come from different tables.

But he can just combine the two queries into one, with a UNION.

Cheers,

Jeff

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

  Powered by Linux