Subject Re: TempDirectories and ALTER INDEX ACTIVE
Author hvlad
--- In firebird-support@yahoogroups.com, Alec Swan wrote:

> My main question is how can we calculate the temp sort space required
> to ALTER INDEX ACTIVE (on all indexes serially) given the size of the
> database? Is twice the size of the database a good upper bound?

Enumerate all fields in index, calculate summa of full size of every
field (for [var]char(N) it is N * bytes_per_char, for ex.), add extra 8
bytes (for record number) - this is sort record size.
Multiply it by number of records and you'll get a lower estimate of
temp space required. Substract value of TempCacheLimit and you'll get
estimate of disk space required.

Regards,
Vlad