SET ICACHE

From Lianjapedia
Jump to: navigation, search

Purpose

Specify number of buffers to use for index files

Syntax

SET ICACHE TO [<expN>] [OPTIMUM]

See Also

DISPLAY STATUS, FIND, ICACHE(), INDEX, LIST STATUS, REINDEX, SEEK, SET CACHELOAD, SET DCACHE, SET FCACHE, TOTAL

Description

The SET ICACHE TO <expN> command specifies the number of index file buffers to be used. The icache buffer is specific to each index file that is opened. The larger the number of ICACHE buffers, the better the performance of FIND and SEEK operations on large tables. The ICACHE can also accelerate the INDEX, REINDEX, TOTAL and SORT commands. If the OPTIMUM keyword is specified, then the optimum size for index caching will automatically be calculated. For manual settings, the <expN> can be calculated with the ICACHE() function.

The value <expN> specified with the SET ICACHE command is the number of disk blocks to be buffered in memory. When a request is made to read a particular disk block from an index file, the ICACHE is first inspected to see if the block is already in memory. If it is, then the block is merely copied from memory. If the block is not in memory, the required block is read from the index file, and placed it in the ICACHE.

Example

set icache to 100
use patrons index events, dates, names
 
// Another example
use accounts index acc_prefix, paid_date
set icache to reccount()
reindex