Re: Planner question - wrong row count estimation - Mailing list pgsql-performance

From Josh Berkus
Subject Re: Planner question - wrong row count estimation
Date
Msg-id 4AB7EE21.5060108@agliodbs.com
Whole thread Raw
In response to Planner question - wrong row count estimation  (Michael Korbakov <m.korbakov@postindustria.com>)
List pgsql-performance
On 9/19/09 5:08 PM, Michael Korbakov wrote:
>                          ->  Hash Join  (cost=8.50..25.11 rows=1
> width=28) (actual time=0.092..1.864 rows=560 loops=1)
>                                Hash Cond:
> (((partners_shares.year)::double precision = (shares.year)::double
> precision) AND ((partners_shares.month)::double precision =
> (shares.month)::double precision))

This appears to be where the estimates go wrong; Postgres may be
assuming random correlation which isn't correct.

My suggestion would be to try and create matching indexes on
date_trunc(daily_domain_reports.date) and month & year of
monthly_shares_with_parents_materialized.

--
Josh Berkus
PostgreSQL Experts Inc.
www.pgexperts.com

pgsql-performance by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: statement stats extra load?
Next
From: Alan McKay
Date:
Subject: Re: statement stats extra load?