Re: Planner question - wrong row count estimation

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Michael Korbakov <m(dot)korbakov(at)postindustria(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Planner question - wrong row count estimation
Date: 2009-09-21 21:20:33
Message-ID: 4AB7EE21.5060108@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Alan McKay 2009-09-21 21:27:48 Re: statement stats extra load?
Previous Message Bruce Momjian 2009-09-21 21:19:29 Re: statement stats extra load?