"Andrus" <kobruleht2@xxxxxx> writes: > Query > SELECT * FROM toode > WHERE toode in (SELECT toode FROM tempkaive) > OR toode in (SELECT toode FROM tempalgsemu) > stops working after upgrading to 9.3 RTM in Windows from earlier version. Just out of curiosity, what "earlier version" was that that was able to run this query quickly? Based on what you've said in this thread, I don't see a reason for 9.3 to be slower than earlier releases for this. The default plan certainly sucks, but that would've been true in earlier releases as well. Personally I'd try to get rid of the OR, perhaps with SELECT * FROM toode WHERE toode in (SELECT toode FROM tempkaive UNION ALL SELECT toode FROM tempalgsemu) You want to end up with a plan that has no "SubPlans" in it, and in a quick check this looked promising. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general