gpdb
gpdb copied to clipboard
Don't simplify uncorrelated EXISTS sublink in some cases
This is another way to fix #11849, more details can be found at #13823.
And is this fix, there has no regression on uncorrelated EXISTS sublinks
that have DISTINCT/DISTINCT ON/ORDER BY clause, but the logic of the
function simplify_EXISTS_query() is more complicated.
This PR and #13823 both can fix issue #11849, and #13823 makes
simplify_EXISTS_query() easier to understand, but has regression in some
cases. This PR makes simplify_EXISTS_query() a little more complicated,
but has no regression.