MonetDB performance adding a new column into an existing table with thousen of columns

61 Views Asked by At

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

1

There are 1 best solutions below

1
On

Try adding START TRANSACTION; above the ALTER TABLE statements, and COMMIT; after.

In a somewhat smaller experiment where I add 10 columns to an existing 2000, the transaction makes it about 3× faster.