I need to add 100 columns into an existing table with 20000 columns in MonetDB, and each alter table command takes 10 seconds.
ALTER TABLE [MYSCHEMA].[MYTABLE] ADD COLUMN [MYCOLUMN] [TYPE] NULL;
x100
The total process takes 1000 seconds to peform the addition. Is there any way to improve the operation?.
Thnks
Try adding
START TRANSACTION;
above theALTER TABLE
statements, andCOMMIT;
after.In a somewhat smaller experiment where I add 10 columns to an existing 2000, the transaction makes it about 3× faster.