CTAS
Rado, August 19, 2016 - 1:08 pm UTC
Thank You for your feedback.
I will have to deal with the index ddl's after.
Will it be the same If use to copy the DDL for the table only and insert some data after.
Regards,
August 19, 2016 - 3:54 pm UTC
If you're not copying the data, you can just write your create table statement as normal.
Or do a CTAS that returns no rows (where 1=0) so you get the column list.
CTAS
Rado, August 19, 2016 - 4:23 pm UTC
Hi,
I have used the following scenario.
1. Get DDL + partitions + indexes of The original table.
2. Renamed all indexes related to the original table.
3. Renamed the original table
4. Created the new table using the ddl script collected in point 1 + all indexes and partitions.
5. Inserted 59k rows as select from the original table in parallel 4.
6. Recompiled all dependencies.
7. Collected fresh statistics.
August 20, 2016 - 3:18 am UTC
Probably would be faster to populate your table and *then* index it.