Re: BUG #8598: Row count estimates of partial indexes - Mailing list pgsql-bugs

From Marko Tiikkaja
Subject Re: BUG #8598: Row count estimates of partial indexes
Date
Msg-id 5289E650.5070802@joh.to
Whole thread Raw
In response to Re: BUG #8598: Row count estimates of partial indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #8598: Row count estimates of partial indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 11/17/13 9:18 PM, Tom Lane wrote:
> Marko Tiikkaja <marko@joh.to> writes:
>> Any suggestions for a workaround?  When reading this index as a part of
>> a bigger query the horrible estimate ensures that nobody's having fun.
>
> Why is the estimate so bad?  I suppose the answer is that those two
> columns are very strongly correlated.  Maybe you could refactor your
> data representation to avoid that?

I'll look into that, thanks.

> The long-term answer as far as Postgres is concerned is to learn about
> cross-column correlations, but that's not happening in the near future.

I'm completely clueless about how the planner works, but wouldn't it be
easier to have some kind of separate stats for the conditions in partial
indexes?  It seems better in all cases than trying infer the stats from
cross-column correlations, even if we had that.


Regards,
Marko Tiikkaja

pgsql-bugs by date:

Previous
From: colin.wright@thinkwhere.com
Date:
Subject: BUG #8592: Windows Installer not setting locality
Next
From: Tom Lane
Date:
Subject: Re: BUG #8598: Row count estimates of partial indexes