I have a table in which inactive records are active, active = 1 for active and active = 0 for inactive.
I have many indexes in this table, but I only need indexes supported for active records, since the application only requests active data. Inactive data must be saved, since it can be activated again, but usually this is done only with bulk updates, which in any case will not use the index.
I notice that indexing inactive records (of which more than active records) takes up a lot of space.
Is there a way in Oracle (10g) to do something like this:
create index an_idx on tab (active, col1, col2, ... , coln) where active = 1 ?
Previous Attempt:
I tried using a function-based index to set the first column to null when active = 0 looks like this:
create index an_idx on tab (decode(active, 1, 1, null), col1, col2, ... , coln)
But Oracle still seems to index inactive columns in this case.
Clinton
source share