  * for tables. For speed, just let CD_ID = SD_ID for tables 
  */
 INSERT INTO CDS (CD_ID)
-SELECT t.SD_ID FROM TBLS t WHERE t.SD_ID IS NOT NULL ORDER BY t.SD_ID;
+SELECT t.SD_ID FROM TBLS t WHERE t.SD_ID IS NOT NULL;
 
 UPDATE SDS
   SET CD_ID = SD_ID
 WHERE SD_ID in 
-(SELECT t.SD_ID FROM TBLS t WHERE t.SD_ID IS NOT NULL ORDER BY t.SD_ID);
+(SELECT t.SD_ID FROM TBLS t WHERE t.SD_ID IS NOT NULL);
 
 INSERT INTO COLUMNS_V2
   (CD_ID, COMMENT, COLUMN_NAME, TYPE_NAME, INTEGER_IDX)

 * Migrate IDXS
 */
INSERT INTO CDS (CD_ID)
SELECT i.SD_ID FROM IDXS i WHERE i.SD_ID IS NOT NULL ORDER BY i.SD_ID;

UPDATE SDS
  SET CD_ID = SD_ID
WHERE SD_ID in 
(SELECT i.SD_ID FROM IDXS i WHERE i.SD_ID IS NOT NULL ORDER BY i.SD_ID);

INSERT INTO COLUMNS_V2
  (CD_ID, COMMENT, COLUMN_NAME, TYPE_NAME, INTEGER_IDX)

  FROM PARTITIONS p
  JOIN TBLS t ON t.TBL_ID = p.TBL_ID
  JOIN SDS sds on t.SD_ID = sds.SD_ID
  WHERE p.SD_ID IS NOT NULL AND sds.CD_ID IS NOT NULL;

UPDATE SDS sd
  SET sd.CD_ID = 
