Skip site navigation (1) Skip section navigation (2)

Re: limit in subquery causes poor selectivity estimation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: limit in subquery causes poor selectivity estimation
Date: 2011-09-04 22:31:38
Message-ID: 9086.1315175498@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
I wrote:
> On a longer-term basis, I'm looking into what we could do with
> extracting stats from subqueries, but that doesn't seem like material
> for a backpatch.  I have a draft patch that I've been playing with
> (attached).

I've committed a heavily rewritten version of that patch.  Git HEAD
seems to do reasonably well on the test case you gave at the start of
this thread.  I'm not sure yet how well the logic will hold up in
real-world queries as opposed to simplified test cases, but give it
a try.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Shigeru HanadaDate: 2011-09-05 05:55:55
Subject: Re: force_not_null option support for file_fdw
Previous:From: Kohei KaiGaiDate: 2011-09-04 18:55:21
Subject: Re: force_not_null option support for file_fdw

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group