'Is it possible to deactivate index in Firebird without dropping it?
From the ib-aid link at RDB$INDICES System Table the RDB$INDICES has a column RDB$INDEX_INACTIVE column which indicates active/inactive status. Is it possible to modify this column to activate or deactivate an index. Could this be done instead of actually dropping/adding an index?
Solution 1:[1]
Yes, you can use ALTER INDEX <indexname> {ACTIVE | INACTIVE}, see the documentation for ALTER INDEX in the Firebird 4.0 Language Reference. This statement is available in all Firebird versions.
For INACTIVE:
With the
INACTIVEoption, the index is switched from the active to inactive state. The effect is similar to theDROP INDEXstatement except that the index definition remains in the database. Altering a constraint index to the inactive state is not permitted.
This last thing is important: you cannot do this for indexes backing a constraint.
For ACTIVE:
With the
ACTIVEoption, if the index is in the inactive state, it will be switched to active state and the system rebuilds the index.
Altering an already active index to ACTIVE will also rebuild the index.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mark Rotteveel |
