RE: Alter a big table
Posted in 2006
An ALTER TABLE does not alter any of the existing rows, it increases the
table version and any new rows will include the columns. Whenever a row
created before the ALTER was executed is updated the new columns will be
added physically to that particular row. the actual execution time for the
ALTER TABLE would be very similar. After the ALTER run oncheck -pT<dbname>:<tbname> and look at the version numbers, this will show the number
of pages that contain rows for each version of the table. It is no big deal
if your data in the table has different versions until you upgrade from 7.31
to 9.40.
Regards
Colin
There are 10 types of people in the world, those that understand binary and
those that don't
>From: "Habichtsberg, Reinhard" <RHabichtsberg@arz-emmendingen.de>
>To: "Informix-List (E-Mail)" <informix-list@iiug.org>
>Subject: Alter a big table
>Date: Mon, 13 Mar 2006 13:25:09 +0100
>
>Hi all,
>
>in a table with logging and fragmentation by round robin I have to add two
>columns at the end:
>
>alter table xxxx
>add (yyy smallint,
> zzzz money(8,2))>;
>
>The table contains about 171,000,000 with a row size of 650 byte. In my
>testing-system with nearly the same number of rows the alter table
>statement
>lasted unter a minute but with LTAPEDEV=/dev/null.
>
>My question: In the production system LTAPEDEV points to an existing
>device.
>Could it happen that the alter table needs much more time to execute and/or
>that we'll run in a long transaction?
>
>TIA
>Reinhard
>
>_______________________________________________
>Informix-list mailing list
>Informix-list@iiug.org
>http://www.iiug.org/mailman/listinfo/informix-list