Subject Re: [firebird-support] Big Index using problem in FB
Author Alexandre Benson Smith
Wei Yu wrote:
> Hi, Alex
>
> Could you please repost the procedure code?
>
> Thanks
>
> William
>

CREATE OR ALTER PROCEDURE THOR_UpdateIndexStatistics
RETURNS
(
INDEXNAME VARCHAR(255) CHARACTER SET ISO8859_1
)
AS
begin
for
select
cast(rdb$Index_Name as varchar(255))
from
rdb$Indices
into
:IndexName
do begin
execute statement 'set statistics index ' || :IndexName;
IndexName = IndexName || ' statistics updated';
suspend;
end
end
^


then you do
select * from THOR_UpdateIndexStatistics;
commit;

atfer your commit, your indices statistics will be up to date.

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br