pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Merlin Moncure <mmoncure@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: Introducing floating point cast into filter drastically changes row estimate
Date: Wed, 24 Oct 2012 16:33:00 -0400
Message-ID: <9033.1351110780@sss.pgh.pa.us> (raw)
In-Reply-To: <CAHyXU0wcNjxwyefE8Vd8cUsHK2yeA_VpAUgnEnF1-VkKXKD=eA@mail.gmail.com>
References: <CAHyXU0zLUJ1jPUW5rJ8c269m=sGFCQd1AuSGudDNFSJ5DFk0QA@mail.gmail.com>
	<6962.1351106799@sss.pgh.pa.us>
	<CAHyXU0wcNjxwyefE8Vd8cUsHK2yeA_VpAUgnEnF1-VkKXKD=eA@mail.gmail.com>

Merlin Moncure <mmoncure@gmail.com> writes:
> Yeah -- I have a case where a large number of joins are happening that
> have a lot of filtering based on expressions and things like that.

Might be worth your while to install some indexes on those expressions,
if only to trigger collection of stats about them.

> I've been thinking about this all morning and I think there's a
> fundamental problem here: the planner is using low confidence
> estimates in order to pick plans that really only be used when the
> plan is relatively precise.  In particular, I think the broad
> assumption that rows pruned via default selectivity should be capped,
> say to the lesser of 1000 or the greatest known value if otherwise
> constrained.

I think that any such thing would probably just move the pain around.
As a recent example, just the other day somebody was bleating about
a poor rowcount estimate for a pattern match expression, which I suspect
was due to the arbitrary limit in patternsel() on how small a
selectivity it will believe.  I'd rather look for excuses to remove
those sorts of things than add more.

			regards, tom lane




view thread (8+ messages)  latest in thread

Message-ID: <9033.1351110780@sss.pgh.pa.us>
Permalink:  ../9033.1351110780@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9033.1351110780@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mmoncure@gmail.com
  Subject: Re: Introducing floating point cast into filter drastically changes row estimate
  In-Reply-To: <9033.1351110780@sss.pgh.pa.us>
  References: <CAHyXU0zLUJ1jPUW5rJ8c269m=sGFCQd1AuSGudDNFSJ5DFk0QA@mail.gmail.com> <6962.1351106799@sss.pgh.pa.us> <CAHyXU0wcNjxwyefE8Vd8cUsHK2yeA_VpAUgnEnF1-VkKXKD=eA@mail.gmail.com> <9033.1351110780@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