Want to group multiple 'CREATE INDEX' into one Transform

Want to group multiple 'CREATE INDEX' into one Transform

 

Transform1   CREATE INDEX idx_1 ON aaaaa(aaa)

Transform2  CREATE INDEX idx_2 ON bbbbb(bbb)

Transform1   CREATE INDEX idx_1 ON aaaaa(aaa);

       CREATE INDEX idx_2 ON bbbbb(bbb);

 

Is this ERR, there is a solution?

 

Comments

  • ST_Superman
    ST_Superman Domo Employee

    I accomplish something similar to this when I have multiple tables that I need to index:

    Transform 1 →

    DROP PROCEDURE IF EXISTS indexing

    Transform 2 →

    CREATE PROCEDURE indexing()
    BEGIN
    ALTER TABLE table_1 ADD INDEX (`Salesforce Account ID`);
    ALTER TABLE table_2 ADD INDEX (`Salesforce Account ID`);
    ALTER TABLE table_3 ADD INDEX (`Salesforce Account ID`);
    ALTER TABLE table_n ADD INDEX (`Salesforce Account ID`);
    END

    Transform 3 →

    CALL indexing()