Re: Slow Query- Bad Row Estimate

From: "Ozer, Pam" <pozer(at)automotive(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Slow Query- Bad Row Estimate
Date: 2010-10-29 21:45:52
Message-ID: 216FFB77CBFAEE4B8EE4DF0A939FF1D1018358@mail-001.corp.automotive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I am not sure what you mean by reformulate the data representation. Do
you mean do I have to join on all three columns?

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Friday, October 29, 2010 2:18 PM
To: Ozer, Pam
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: [PERFORM] Slow Query- Bad Row Estimate

"Ozer, Pam" <pozer(at)automotive(dot)com> writes:
> Unfortunately I have not received a response on this question. Is
more
> information needed? Does anyone have any ideas why the estimates may
be
> bad? Or what I might be able to do to speed this up?

The most likely explanation for the bad rowcount estimates is that there
is correlation between the regionid/countyid/cityid columns, only the
planner doesn't know it. Can you reformulate that data representation
at all, or at least avoid depending on it as a join key?

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Ozer, Pam 2010-10-29 21:47:55 Re: Slow Query- Bad Row Estimate
Previous Message Kevin Grittner 2010-10-29 21:39:56 Re: Slow Query- Bad Row Estimate