Re: Incorrect estimates on correlated filters - Mailing list pgsql-performance

From Alvaro Herrera
Subject Re: Incorrect estimates on correlated filters
Date
Msg-id 20080813205830.GC4672@alvh.no-ip.org
Whole thread Raw
In response to Re: Incorrect estimates on correlated filters  ("Chris Kratz" <chris.kratz@vistashare.com>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Henrik
Date:
Subject: Re: Filesystem benchmarking for pg 8.3.3 server
Next
From: Alvaro Herrera
Date:
Subject: autovacuum: use case for indenpedent TOAST table autovac settings