Re: Andrus 2013-09-23 <E04C65FDEE80430DB6499621E2EC36BC(at)dell2>
> SELECT * FROM toode
> WHERE toode in (SELECT toode FROM tempkaive)
> OR toode in (SELECT toode FROM tempalgsemu)
Generally, WHERE IN (SELECT) should be rewritten as WHERE EXISTS
(SELECT):
SELECT * FROM toode o
WHERE EXISTS (SELECT toode FROM tempkaive i WHERE o.toode = i.toode)
OR EXISTS (SELECT toode FROM tempalgsemu i WHERE o.toode = i.toode)
Also, ANALYZEing the tables after the upgrade might help if this has
not yet been done.
Christoph
--
cb(at)df7cb(dot)de | http://www.df7cb.de/