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

2014-11-22 Thread Tom Lane
David Rowley 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 same thing, either

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 wrote: > On Wed, Oct 22, 2014 at 1:37 PM, David Rowley > 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-26 Thread Marti Raudsepp
On Wed, Oct 22, 2014 at 1:37 PM, David Rowley 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 or ALL, to > +

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 wrote: > On Sun, Oct 19, 2014 at 1:22 PM, David Rowley > 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

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 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 every release.

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 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() subqueries, an

[HACKERS] [PATCH] Simplify EXISTS subqueries containing LIMIT

2014-10-02 Thread Marti Raudsepp
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() subqueries, and it even makes sense when you're not aware that the database alread