Search Postgresql Archives

Re: Query runs forever after upgrading to 9.3

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

 



Hi,

Just out of curiosity, what "earlier version" was that that was able to
run this query quickly?

It was installed in customer site at May 2012 in Windows 2003 server and
latest RTM version of Postgres
x32 in this time was used.

In this year server was upgraded to Windows 2008 x64 server and Postgres 9.3
x64 was used, database was restored from backup copy.
After that this query started to run forever so I assumed that this was
Postgres version issue.

It is probably possible to try to reproduce the issue by restoring it to
earlier version.

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.

I fixed the issue by using

create index tempkaivetoode on tempkaive(toode);
create index tempalgemutoode on tempalgsemu(toode);

and using exists.

Will your suggestion run faster ? Is it reasonable to switch to use your
suggestion ?

Andrus.


--
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