John Mendenhall <john@surfutopia.net> writes:
> Would it be best to attempt to rewrite it for IN?
> Or, should we try to tie it in with a join?
Couldn't say without a deeper understanding of what you're trying to
accomplish.
> BTW, what does the Materialize query plan element mean?
Means "run the contained subplan once, and save the results aside in a
buffer; on subsequent loops, just pass back the buffer contents instead
of re-running the subplan".
regards, tom lane