Re: [HACKERS] [PATCH] Simplify EXISTS subqueries containing LIMIT

2014-11-22 Thread Tom Lane
David Rowley dgrowle...@gmail.com writes: I'm reasonably happy with the patch now, the only small niggles are maybe the Assert() is probably not so much needed as transformLimitClause() seems to coerce to int8 anyway, and recompute_limits() does not bother with the Assert() when it does the

Re: [HACKERS] [PATCH] Simplify EXISTS subqueries containing LIMIT

2014-10-26 Thread Marti Raudsepp
On Wed, Oct 22, 2014 at 1:37 PM, David Rowley dgrowle...@gmail.com wrote: I've had a bit of a look at this and here's a couple of things: Thanks. Sorry I didn't back to you earlier, I almost forgot about the review. /* +* LIMIT clause can be removed if it's a positive constant

Re: [HACKERS] [PATCH] Simplify EXISTS subqueries containing LIMIT

2014-10-26 Thread David Rowley
On Mon, Oct 27, 2014 at 1:56 AM, Marti Raudsepp ma...@juffo.org wrote: On Wed, Oct 22, 2014 at 1:37 PM, David Rowley dgrowle...@gmail.com wrote: I've had a bit of a look at this and here's a couple of things: Thanks. Sorry I didn't back to you earlier, I almost forgot about the review.

Re: [HACKERS] [PATCH] Simplify EXISTS subqueries containing LIMIT

2014-10-22 Thread David Rowley
On Tue, Oct 21, 2014 at 11:00 PM, Marti Raudsepp ma...@juffo.org wrote: On Sun, Oct 19, 2014 at 1:22 PM, David Rowley dgrowle...@gmail.com wrote: the argument for this would have been much stronger if anti join support had just been added last week. It's been quite a few years now and

Re: [HACKERS] [PATCH] Simplify EXISTS subqueries containing LIMIT

2014-10-21 Thread Marti Raudsepp
Hi Thanks for taking a look. On Sun, Oct 19, 2014 at 1:22 PM, David Rowley dgrowle...@gmail.com wrote: the argument for this would have been much stronger if anti join support had just been added last week. It's been quite a few years now and the argument for this must be getting weaker with

Re: [HACKERS] [PATCH] Simplify EXISTS subqueries containing LIMIT

2014-10-19 Thread David Rowley
On Fri, Oct 3, 2014 at 10:41 AM, Marti Raudsepp ma...@juffo.org wrote: Hi list, Attached patch allows semijoin/antijoin/hashed SubPlan optimization when an EXISTS subquery contains a LIMIT clause with a positive constant. It seems to be a fairly common meme to put LIMIT 1 into EXISTS()