Re: Alter table (with large no. of data)
Posted in 1998
Felix Mathews wrote: > June Tong wrote: > > > > Sujit.Pal@alltel.com wrote: > > > > > You would need to increase the number of logical logs. The reason is > > > that DDL statements such as ALTER are always logged regardless of > > > whether your database is logged or not. > > > > Yes, that's true, but the ALTER statement by itself is not what's filling up the > > logical logs; it's all the individual INSERT statements that result from the ALTER, > > as the engine copies all the rows from the original table to the new table. These > > would not be logged if the database had logging turned off. > > > > Above situation was true for IDS up to 7.2X. From IDS 7.30 onwards > Informix handles it in a different way, by altering table information > and leaving the data virtually untouched. This avoids the creation of > a new table and duplication of all the data, before dropping the > original. Which brings me back to my original point, that if he is on *7.20* or later, he can simply add the column to the end of the row and take advantage of in-place alter table. In 7.20, you can add a new column without re-building the table, as long as the new column is at the end of the row. 7.30 expanded the number of alterations you can do in-place (don't remember what they were), but the addition of columns in-place was already in 7.20. My point here was simply that, although the ALTER TABLE statement is logged, that alone would not fill up the logs if the database had no logging. June -- june_t@hotmail.com Lost in the wilds of Palo Alto, living on KitKat bars