Subject | Re: REBUILDING the INDEXES in Firebird |
---|---|
Author | Adam |
Post date | 2006-01-27T21:33:02Z |
> >How to do reindexing in FirebirdThe above command will not work on indices created by primary or
> >Is there any build in SP to do OR we have to fire any SQL command
> >
> >
> >
> ALTER INDEX <indexName> INACTIVE;
foreign key constraints etc, as they can not be deactivated. IIRC, you
can just run the following command to rebuild. Someone can fill in the
blanks (confirm or tell me I am crazy)
> ALTER INDEX <indexName> ACTIVE;Also, if you rebuilt an index, does it regenerate the statistics, or
>
> Note: since ALTER INDEX is a DDL command it cannot be used
> inside a stored procedure.
>
would setting them again be a good idea?
I had a database the other week where I knew some of the indices were
skewed and the statistics were horribly out of date and "the gap" was
about 10K, so I thought it an opportune time to backup-restore. This
of course fixed it, but it left me wondering whether it could have
been fixed up by simply running a script to set every active index to
active and running sweep.
Adam