Hi,

I was tested FB3.0.1 Windows 64 with different result.

DaviceData is table with several millions of rows.

alter table DeviceData add a integer default 7 not null;

This is fast, just few ms.

But commit was taken several minutes with high disk activities.

Also I made another test.

1. alter table with default.

2. commit

3. drop default

4. commit

5. select and you will that new column has default value but metadata is 
without default.

 From my point of view is as should be because in other way you will 
have inconsistent DB like in FB2.5 after add not null column.

Slavek

>> Big disadvantages of default is:
>>
>> 1. Immediately update all rows in table.
>>
>> Interesting only if all or most already existed rows will use this value.
>>
> No. DEFAULT is a constant expression and is stored in table metadata and
> associated with the new table format number. It does not update existing
> rows, so is much better than manually update the table.
>
>
> Adriano
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> Firebird-Devel mailing list, web interface at 
> https://lists.sourceforge.net/lists/listinfo/firebird-devel
>



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to