Subject Re: [firebird-support] Re: best way to set statistics index on new database
Author Pavel Cisar
Bill Oliver wrote:
> Thanks Ann, Martijn,
>
>> But for a newly created database, why build indexes incrementally
>> then set statistics, when creating indexes after the data is loaded
>> is faster, builds better indexes, and gets the statistics right
>> automatically?
>>
>
> I suppose the user finds it more logical to submit all of the DDL
> first and create the data model up front.
>
> If you used a data modeling tool like Erwin, you would get an output
> SQL file that would have the tables and indexes created in one place.

Another way is to create indices together with other database objects,
but as INACTIVE, then activate them after data insert. You can use the
same EXECUTE BLOCK, but with ALTER INDEX ... ACTIVE instead SET
STATISTICS command.

best regards
Pavel Cisar
IBPhoenix