I would like to thank everyone far in advance for any help they can give me on this quesiton.
I have several statements that perform what should be a simple update on a single table. However, when placed against a full production load it has never completed (I probably don't have the patience to wait several days)
In any case here is the scenario:
staging table = 2.2 million rows
person table = 700K rows
Staging table has an index on uniquekey and a unique index on uniquekey, class, class_system
person has indexes on uniquekey, plus several irrelevant ones.
The simplest of the queries I am running is
As I said this is the simplest of the queries and it is choking. Is this because of how I am using the EXISTS statement?
The person table is a fairly wide table., staging is not very wide.
Any help would be greatly appreciated!
Patrick
I have several statements that perform what should be a simple update on a single table. However, when placed against a full production load it has never completed (I probably don't have the patience to wait several days)
In any case here is the scenario:
staging table = 2.2 million rows
person table = 700K rows
Staging table has an index on uniquekey and a unique index on uniquekey, class, class_system
person has indexes on uniquekey, plus several irrelevant ones.
The simplest of the queries I am running is
Code:
UPDATE staging SET mig_status = 80 WHERE EXISTS
(SELECT * FROM person WHERE person.XUNIQUEKEY = staging.xuniquekey
AND xempstatus IN ('A', 'P', 'L', 'Q'))
AND (mig_status IN (0, 3, 6, 7)
OR mig_status IS NULL)
As I said this is the simplest of the queries and it is choking. Is this because of how I am using the EXISTS statement?
The person table is a fairly wide table., staging is not very wide.
Any help would be greatly appreciated!
Patrick