On Mon, 1 Jun 2009, Koen Martens wrote:
Anyway, any hints on getting this beast perform (without rewriting the query,
that's not possible in this case due to
the query being generated by an ORM) are welcome. I'm starting to think it is
impossible, and that postgresql just
doesn't work for this
On Mon, 1 Jun 2009, Koen Martens wrote:
Anyway, any hints on getting this beast perform (without rewriting the
query, that's not possible in this case due to the query being generated
by an ORM) are welcome. I'm starting to think it is impossible, and that
postgresql just doesn't work for this
2009/6/1 Koen Martens
>
> Now, when I split up the OR in two distinct queries, everything is nice and
> fast. Both queries run in sub-second time.
Hi.
PostgreSQL simply do not like ORs (can't use indexes in this case), so
UNION/UNION ALL is your friend.
Best regards, Vitalii Tymchyshyn