Hi you all,
I have thousands of databases schema to update (add a column, update some rows and add 3 rows in 2 different tables).
I have 2 different approaches to do so:
1) Put the name of each schema before table names
# database A01be91a86
UPDATE A01be91a86.ACTION set CODE_QUALIFICATION....
ALTER table A01e02a697.IMPRESSION add column NAME.....
# database blabla
....
....
# thousand databases
# database zfc982251d
UPDATE zfc982251d.ACTION set CODE_QUALIFICATION....
ALTER table zfc982251d.IMPRESSION add column NAME.....
2) connect to the database schema before each update
# database A01be91a86
connect A01be91a86
UPDATE ACTION set CODE_QUALIFICATION....
ALTER table IMPRESSION add column NAME.....
# database blabla
....
....
# thousand databases
# database zfc982251d
connect zfc982251d
UPDATE ACTION set CODE_QUALIFICATION....
ALTER table IMPRESSION add column NAME.....
The goal is to limit the time the whole script will take to execute
What is the best approach? The first one or the second one? Or maybe a third one I didn't think of.
Thank you guys