Subject Re: [firebird-support] Recreate indexes
Author Thomas Steinmaurer
> and so I can't recreate all index?
> Or I have only to skyp primary key?

You have to skip those underlaying indexes, which are part of a constraint.

For example, the following system table query gives you a list of
indexes, which can be deactivated/activated:

select
i.rdb$index_name
from
rdb$indices i
where
(i.rdb$system_flag = 0 or i.rdb$system_flag is null)
and not exists (
select
1
from
rdb$relation_constraints rc
where
rc.rdb$index_name = i.rdb$index_name
)


> But If I need to recreate PK what I have to do?

You have to drop the constraint and re-create it afterwards.


The whole thing is different, if we are talking about the SET STATISTICS
statement. This statement can be executed against any index. See
Fabiano's reply.



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