Subject Re: [firebird-support] UPDATE Statistics or other maintenance?
Author Ann W. Harrison
Raymond J. Schappe wrote:
> I have seen occasional mentions of using
>
> SELECT COUNT(*) FROM myTable
>
> To update the internal statistics... Is this true???

No. The way to update internal statistics is to use the SET STATISTICS
statement for indexes. SELECT COUNT (*) is suggested from time to time
as a way to force garbage collection after a mass modify or delete.
Gbak does the same thing. It pays to remember that the SELECT COUNT (*)
works only if the transaction that performed the update or delete and
all concurrent transaction have ended.
>
> We have been performing a gbak backup and a gbak restore each night...
> so I am curious if we need to be doing anything more to keep the
> database in good shape.

If you always do a backup and restore, your databases are in fine shape
- and you can speed up the process by using the -g switch on gbak
telling it to skip the garbage collection. Why bother to clean house
before you burn it down?
>

Regards,


Ann