Subject Re: [firebird-support] How can I rebuild a PK index?
Author Helen Borrie
At 12:23 AM 19/12/2005 +1100, I wrote:

> >So my questions:
> >
> >1) Why hasn't this index already been computed? I thought it was
> >automatic...

I wrote:

>It is - but it only happens a) at startup (when the first user connects to
>the database after all have disconnected)

or b) when you run SET STATISTICS from isql.

"It" being recomputing the index statistics. This *isn't* the same thing
as [re]building the index, though.

You wrote:

> >2) How can I (programatically) recompute the index (without gbak)?

I wrote

>You can't drop constraint indexes - you need to drop the constraint and
>then re-apply it.

--- to REBUILD indexes. Of course you don't drop constraints for
recomputing the index statistics, natch.

But it's not clear what you mean by "programmatically", either. Dropping
constraints or altering indexes aren't things you can do while the index is
in use...and dropping an integrity constraint requires exclusive sysdba or
owner access (a shut-down database).