pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Denis de Bernardy <ddebernardy@yahoo.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: row estimate very wrong for array type
Date: Wed, 04 May 2011 10:12:49 -0400
Message-ID: <10497.1304518369@sss.pgh.pa.us> (raw)
In-Reply-To: <625605.72736.qm@web112406.mail.gq1.yahoo.com>
References: <625605.72736.qm@web112406.mail.gq1.yahoo.com>

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



view thread (4+ messages)  latest in thread

Message-ID: <10497.1304518369@sss.pgh.pa.us>
Permalink:  ../10497.1304518369@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10497.1304518369@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ddebernardy@yahoo.com
  Subject: Re: row estimate very wrong for array type
  In-Reply-To: <10497.1304518369@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox