Subject Re: [firebird-support] Large DB after batch import: index rebuild/set stats, backup/restore?
Author Kjell Rilbe
Thomas Steinmaurer skriver:
> @Kjell: For recalculating the index statistics, add the following SP to
> your database.
>
> SET TERM ^^ ;
> CREATE PROCEDURE S_RECALCINDEXSTATS returns (
> INDEX_NAME VarChar(31),
> STATUS VarChar(31))
> AS
> begin
> for select rdb$index_name from rdb$indices into :index_name do
> begin
> execute statement 'set statistics index ' || index_name || ';';
> status = 'Recalculated!';
> suspend;
> when any do
> begin
> status = 'Failed!';
> suspend;
> end
> end
> end ^^
> SET TERM ; ^^
>
> To be executed with:
>
> select * from s_recalcindexstats

Thanks! I think I saw an execute block that does something similar,
maybe at the FAQ site.

Regards,
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64