Re: row estimate very wrong for array type - Mailing list pgsql-performance

From Tom Lane
Subject Re: row estimate very wrong for array type
Date
Msg-id 10497.1304518369@sss.pgh.pa.us
Whole thread Raw
In response to row estimate very wrong for array type  (Denis de Bernardy <ddebernardy@yahoo.com>)
Responses Re: row estimate very wrong for array type  (Denis de Bernardy <ddebernardy@yahoo.com>)
List pgsql-performance
Denis de Bernardy <ddebernardy@yahoo.com> writes:
> [ estimates for array && suck ]
> Might this be a bug in the operator's selectivity, or am I doing something wrong?

Array && uses areasel() which is only a stub :-(

In the particular case here it'd be possible to get decent answers
just by trying the operator against all the MCV-list entries, but it's
unlikely that that would fix things for enough people to be worth the
trouble.  Really you'd need to maintain statistics about the element
values appearing in the array column in order to get useful estimates
for && queries.  Jan Urbanski did something similar for tsvector columns
a year or two ago, but nobody's gotten around to doing it for array
columns.

            regards, tom lane

pgsql-performance by date:

Previous
From: Shaun Thomas
Date:
Subject: Re: amazon ec2
Next
From: Denis de Bernardy
Date:
Subject: Re: row estimate very wrong for array type