AW: [PERFORM] hashed subplan 5000x slower than two sequential operations
Hello,
are the table freshly analyzed, with a sufficient default_statistics_target ?
It is way better
You may try to get a better plan while rewriting the query as an UNION to get rid of the OR clause.
Something like (not tested):