Search Postgresql Archives

Re: Query runs forever after upgrading to 9.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux