Re: [PERFORM] Very inefficient query plan with disjunction in WHERE clause

2009-06-02 Thread Matthew Wakeling
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

Re: [PERFORM] Very inefficient query plan with disjunction in WHERE clause

2009-06-02 Thread Matthew Wakeling
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

Re: [PERFORM] Very inefficient query plan with disjunction in WHERE clause

2009-06-01 Thread Віталій Тимчишин
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