Sample Header Ad - 728x90

Copy indexes from one table to another

9 votes
4 answers
12094 views
I have a series of ETL jobs in which I create a swap table using CREATE TABLE table1_swap LIKE table1. In order to make the populating of table1_swap faster I do not include the indexes. When I'm finished loading however I need to re-apply those indexes to the newly populated table. These indexes are created outside of the scope of these ETL jobs so I would rather not have to hardcode the CREATE INDEX calls if I don't have to. Is it possible to "transfer" or "copy" a set of indexes from one table to another?
Asked by Kyle Decot (359 rep)
Nov 2, 2015, 07:38 PM
Last activity: Dec 11, 2024, 05:02 AM