Subject RE: [firebird-support] Update RDB$INDICES
Author Thomas Steinmaurer
David,

> I'm using FB1.5 for Linux.
>
> Is is possible (or desirable) to perform:
>
> 'UPDATE RDB$INDICES SET RDB$INDEX_INACTIVE = 0'

Theoretically yes, but practically no. ;-)

First of all, updating the system tables directly when there is
an equivalent DDL statement, is a bad thing.

And second, you've to activate the indices in the right order.
For instance, you've to activate an index of a primary key
constraint before activating an index used in a foreign key
which refers to that primary key.


> to activate all of the indexes that were set to inactive after
> performing a "gbak -r -i" for a problemed database? Will FB
> automatically rebuild these indexes internally if I perform this update?
>
> Or should I skip using an update statement, and use the proper 'ALTER
> INDEX index_name ACTIVE;' statement?

What I would do is, create a selectable stored procedure
which queries to rdb$indices table to generate a DDL
script including the ALTER INDEX ... statement.

Rearrange these statements manually and execute that
script against your database.

Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database and MS SQL Server
Upscene Productions
http://www.upscene.com