On 2020-02-26 06:22, Matthias Winkler spmm...@gmail.com 
[firebird-support] wrote:
> Hello Firebird-Group,
> 
> With our device we recalculate statistics ALWAYS when booting up the
> system. Now the DB grows bigger this can now take more than 10 minutes
> and delays
> the time until we can really work with the system. As it is not a
> server and we expect the system to be restart from time to time this
> is a problem.

Recalculating statistics is not a blocking operation. If done correctly 
(eg in a separate thread or process), your system should be available 
immediately, with a (minor) impact on performance.

> Is there a better way to find out when to recalculate statistics?
> - After n inserts?
> - After n days?
> 
> And: Is it really such a big performance benefit to recalc the
> statistics at all?

The statistics in Firebird are pretty basic, and recalculating them 
daily will not add much value. The resulting statistics will likely be 
very similar to the previous and not change the optimizers decisions. 
After a database has been filled with a representative set of data, 
recalculating statistics might be of value after an order of magnitude 
change in volume (number of records), or if the selectivity of an index 
changes significantly (eg if previously an indexed column had only a few 
different values (low selectivity), and now has a lot of different 
values (high selectivity)), and even that might be debatable.

Mark
  • [firebird-supp... Matthias Winkler spmm...@gmail.com [firebird-support]
    • Re: [fire... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
    • RE: [fire... liviuslivius liviusliv...@poczta.onet.pl [firebird-support]

Reply via email to