Re: [HACKERS] Removing LEFT JOINs in more cases

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Removing LEFT JOINs in more cases
Date: 2018-07-15 13:42:27
Message-ID: CAKJS1f8WOFQibaW0ayRy=dn569CFC4h8VQuaBsjYwuhEMsVTQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4 March 2018 at 21:43, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com> wrote:
> Please find attached two patches. The first of which is intended to
> resolve the issue mentioned above with consideration that it may need
> to be back-patched to where LEFT JOIN removals where introduced.
>
> Patch two is intended to implement LEFT JOIN removal for cases that
> any duplicates rows that the join causes would be subsequently removed
> again via a GROUP BY or DISTINCT clause.

I've attached an updated version of this patch. This time there's only
1 patch. Per the discussion above about volatile functions, there's no
need to disallow the join removal when there are volatile functions in
the join clauses.

The only changes to the 0002 patch are now that it's named 0001 and
the tests were changed slightly as a plpgsql function was defined in
the old 0001 which we need for the new 0001.

http://commitfest.cputube.org was also complaining about the tests
failing. This was due to a plan changed caused by 1007b0a1. The plan
change was in the old 0001 patch, which I'm now dropping, so
hopefully, a new email with just the 1 patch will let cputube know
about me dropping the other one.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
v3-0001-Allow-LEFT-JOINs-to-be-removed-in-more-cases.patch application/octet-stream 19.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2018-07-15 14:43:36 Re: [HACKERS] PATCH: multivariate histograms and MCV lists
Previous Message Tomas Vondra 2018-07-15 13:29:16 Re: [HACKERS] PATCH: multivariate histograms and MCV lists