I have a table with 30k rows. Adding a column (e.g. below) takes ~10 seconds.
I need to add 50-odd columns, but this takes 10 minutes.
ALTER TABLE myTable ADD COLUMN IF NOT EXISTS myCol1 DOUBLE;
ALTER TABLE myTable ADD COLUMN IF NOT EXISTS myCol2 VARCHAR;
I've seen this syntax:
ALTER TABLE myTable ADD (myCol1 DOUBLE, myCol2 VARCHAR);
Which seems faster (or at least, a constant time rather than a multiple off the number of columns) but this doesn't seem to support IF NOT EXISTS
.
Is there any way to optimise this?