Difference between revisions of "SET DCACHE"
Yvonnemilne (Talk | contribs) |
Helengeorge (Talk | contribs) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Map table into memory | Map table into memory | ||
Line 12: | Line 5: | ||
==Syntax== | ==Syntax== | ||
SET DCACHE TO [<expN>] [OPTIMUM] | SET DCACHE TO [<expN>] [OPTIMUM] | ||
+ | |||
SET DCACHE ON | OFF | (<expL>) | SET DCACHE ON | OFF | (<expL>) | ||
==See Also== | ==See Also== | ||
− | SET CACHELOAD, SET GCACHE, SET ICACHE, SET PCACHE | + | [[SET CACHELOAD]], [[SET GCACHE]], [[SET ICACHE]], [[SET PCACHE]] |
==Description== | ==Description== | ||
If SET DCACHE is ON when a table is used, then the table records will be ’cached’ in memory, and the records which are not held in memory will be read in when they are needed. | If SET DCACHE is ON when a table is used, then the table records will be ’cached’ in memory, and the records which are not held in memory will be read in when they are needed. | ||
+ | |||
The SET DCACHE TO <expN> command allows the number of records held in memory to be specified on a per table basis. If the optional OPTIMUM keyword is specified, the optimum dcache size will automatically be set. The table ’cache ’ area acts as a ’window’ into the table. Each record referenced in the table is ’mapped’ into the table cache using the simple formula: | The SET DCACHE TO <expN> command allows the number of records held in memory to be specified on a per table basis. If the optional OPTIMUM keyword is specified, the optimum dcache size will automatically be set. The table ’cache ’ area acts as a ’window’ into the table. Each record referenced in the table is ’mapped’ into the table cache using the simple formula: | ||
Line 26: | Line 21: | ||
Using this formula with a table cache of 500, record 1 maps into slot 1, record 501 also maps into slot 1. When a slot is referenced which already contains a record, and that record has been modified since it was read from the table, then the table is updated with the modified record and the required record is read into the cache slot. When a table is closed, modified records held in memory are written into the table. | Using this formula with a table cache of 500, record 1 maps into slot 1, record 501 also maps into slot 1. When a slot is referenced which already contains a record, and that record has been modified since it was read from the table, then the table is updated with the modified record and the required record is read into the cache slot. When a table is closed, modified records held in memory are written into the table. | ||
+ | |||
The SET DCACHE command has no effect if a table is shareable, unless SET GCACHE is set ON. When SET GCACHE is ON, SET DCACHE and SET ICACHE operate on a distributed basis. The SET CACHELOAD command can be used in association with the SET DCACHE command. This forcibly loads the table and index cache when the table is used exclusively. The SET ICACHE command can be used to ’cache’ index keys in memory. By default, DCACHE is OFF. | The SET DCACHE command has no effect if a table is shareable, unless SET GCACHE is set ON. When SET GCACHE is ON, SET DCACHE and SET ICACHE operate on a distributed basis. The SET CACHELOAD command can be used in association with the SET DCACHE command. This forcibly loads the table and index cache when the table is used exclusively. The SET ICACHE command can be used to ’cache’ index keys in memory. By default, DCACHE is OFF. | ||
==Example== | ==Example== | ||
− | < | + | <code lang="recital"> |
// Open up payroll system | // Open up payroll system | ||
set exclusive on | set exclusive on | ||
Line 41: | Line 37: | ||
use employees index name, emp_code | use employees index name, emp_code | ||
set dcache off | set dcache off | ||
− | use wages index emp_code</ | + | use wages index emp_code</code> |
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
− | [[Category:Set_Commands]] | + | [[Category:Set_Commands|DCACHE]] |
+ | [[Category:Performance and Optimization]] | ||
+ | [[Category:Performance and Optimization]] | ||
+ | [[Category:Performance and Optimization Set Commands]] |
Latest revision as of 15:32, 23 November 2009
Purpose
Map table into memory
Syntax
SET DCACHE TO [<expN>] [OPTIMUM]
SET DCACHE ON | OFF | (<expL>)
See Also
SET CACHELOAD, SET GCACHE, SET ICACHE, SET PCACHE
Description
If SET DCACHE is ON when a table is used, then the table records will be ’cached’ in memory, and the records which are not held in memory will be read in when they are needed.
The SET DCACHE TO <expN> command allows the number of records held in memory to be specified on a per table basis. If the optional OPTIMUM keyword is specified, the optimum dcache size will automatically be set. The table ’cache ’ area acts as a ’window’ into the table. Each record referenced in the table is ’mapped’ into the table cache using the simple formula:
position = mod(<record number>, <cache size>)
Using this formula with a table cache of 500, record 1 maps into slot 1, record 501 also maps into slot 1. When a slot is referenced which already contains a record, and that record has been modified since it was read from the table, then the table is updated with the modified record and the required record is read into the cache slot. When a table is closed, modified records held in memory are written into the table.
The SET DCACHE command has no effect if a table is shareable, unless SET GCACHE is set ON. When SET GCACHE is ON, SET DCACHE and SET ICACHE operate on a distributed basis. The SET CACHELOAD command can be used in association with the SET DCACHE command. This forcibly loads the table and index cache when the table is used exclusively. The SET ICACHE command can be used to ’cache’ index keys in memory. By default, DCACHE is OFF.
Example
// Open up payroll system set exclusive on set cacheload on set icache to 3000 set dcache to 1000 use payroll index pay_date, emp_code // Cache the employee records in memory set dcache on use employees index name, emp_code set dcache off use wages index emp_code
Products
Recital Server, Recital