Re: NOT IN subquery optimization - Mailing list pgsql-hackers

From Li, Zheng
Subject Re: NOT IN subquery optimization
Date
Msg-id 61BFFE8C-F884-4936-BB28-0098283F4719@amazon.com
Whole thread Raw
In response to NOT IN subquery optimization  (Jim Finnerty <jfinnert@amazon.com>)
Responses Re: NOT IN subquery optimization
List pgsql-hackers
-----
    To avoid planning the subquery again later on, I want to keep a pointer of
    the subplan in SubLink so that we can directly reuse the subplan when
    needed. However, this change breaks initdb for some reason and I'm trying to
    figure it out.
-----

"make clean" solved the initdb issue. This new patch keeps a pointer of the subplan
 in SubLink so that we can directly reuse the subplan when needed. When the subplan
is not hashable (too big to fit in work_mem), the NOT IN query will be flattened to
an ANTI JOIN and we won't need to use subplan again. However, when the subplan
is hashable, we don't do the conversion and will need to use subplan later, patch v2.1
avoids planning the subquery twice in this case.

-----------
Zheng Li
AWS, Amazon Aurora PostgreSQL    
    


Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Valgrind failures in Apply Launcher's bgworker_quickdie() exit
Next
From: Peter Eisentraut
Date:
Subject: Re: initdb recommendations