unique index

Post Reply
sourceuno
Posts: 225
Joined: Mon Apr 09, 2001 3:58 pm

unique index

Post by sourceuno »

Does the existence of unique indexes have any performance effect when performing updates to a table? I ran some updates on a table that has about 10 million records along with some unique indexes, but the script exited with an ABEND error. I assumed the indexes were corrupt so I removed them and re-ran the updates on the table without indexes, but now it seems like the updates are taking a long time. Do you have any tips for speeding up the performace of updates on a table?
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

unique index

Post by John »

An index will speed up the updates if the where clause in the update can use the index. It does not make a difference if the index is unique or not. In general additional indexes will slow updates down slightly, as the indexes need to be maintained.
John Turnbull
Thunderstone Software
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

unique index

Post by mark »

The key field for an update should be indexed. Otherwise it will have to linearly search for each record to update. A very slow process on a large table.

More indices obviously require a little more processing per record during inserts/deletes/updates.
Post Reply