Subject alter index
Author Nick Upson
fb1.5.3

I have a situation where the system will take on a load of data
initially and then remain fairly static. Would the following safely
rebuild the indexes? would it be safe if the system was running while
it was run?


FOR SELECT RDB$INDEX_NAME
FROM RDB$INDICES
INTO :IDX
DO
BEGIN
STMT = 'ALTER INDEX INDEX ' || :IDX || ' INACTIVE';
EXECUTE STATEMENT :STMT;
STMT = 'ALTER INDEX INDEX ' || :IDX || ' ACTIVE';
EXECUTE STATEMENT :STMT;
END