Re: Incorrect estimates on correlated filters

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

 



Chris Kratz wrote:

> Unfortunately, if I don't think the sorting idea would help in the one case
> I'm looking at which involves filters on two tables that are joined
> together.  The filters happen to be correlated such that about 95% of the
> rows from each filtered table are actually returned after the join.
> Unfortunately, the planner thinks we will get 1 row back.

Maybe you can wrap that part of the query in a SQL function and set its
estimated cost to the real values with ALTER FUNCTION ... ROWS.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

  Powered by Linux