Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Wayne Conrad <wconrad(at)yagni(dot)com> writes:
>> Total runtime: 244572.432 ms
> I'll take a look at fixing that, but not sure if it'll be
> reasonable to back-patch or not. In the meantime, you need to
> look into restructuring the query to avoid nesting the EXISTS
> probes, if possible.
Wayne, I think your best bet at this point may be to just (INNER)
JOIN the three tables, and if there is a possibility of duplicates
to use SELECT DISTINCT.
-Kevin