Re: [HACKERS] convert EXSITS to inner join gotcha and bug - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: [HACKERS] convert EXSITS to inner join gotcha and bug
Date
Msg-id ead7502c-a0bf-641e-6ebd-69dddb9165a5@sigaev.ru
Whole thread Raw
In response to Re: [HACKERS] convert EXSITS to inner join gotcha and bug  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Really, the way to fix Teodor's complaint is to recognize that the
> semijoin inner rel is effectively unique against the whole outer rel,
> and then strength-reduce the semijoin to a plain join.  The infrastructure
> we built for unique joins is capable of proving that, we just weren't
> applying it in the right way.
Perfect, it works. Thank you! Second patch reduces time of full query (my 
example was just a small part) from 20 minutes to 20 seconds.

> I'm kind of strongly tempted to apply the second patch; but it would
> be fair to complain that reduce_unique_semijoins() is new development
> and should wait for v11.  Opinions?

Obviously, I'm voting for second patch applied to version 10.

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] [PROPOSAL] Use SnapshotAny in get_actual_variable_range
Next
From: Ilya Shkuratov
Date:
Subject: [HACKERS] CTE inlining