..CtCacheSize is used to find out and modify the maximum number of records that can be stored in the cache of the Native MySQL Access.
Managing the cache: operating mode
Whenever accessing an external database, the records retrieved are stored in the cache of the Native Access used before they are transmitted to the client computer.
The cache of a Native Access can contain a limited number of records. If the number of records to retrieve is greater than the maximum number of records defined for the cache, the records are retrieved in batches.
The maximum number of records that can be stored in the cache corresponds to the size of the cache.
For example, if the size of the cache is equal to 10, the cache will be filled 3 times when running a query that selects 24 records:
- 10 records.
- 10 records.
- 4 records.
// Modify the size of the cache for the Native MySQL Access used by MyConnection
MyConnection..CtCacheSize = 450
Syntax
Finding out the size of the cache for the Native MySQL Access Hide the details
<Cache size> = <Connection name>..CtCacheSize
<Cache size>: Integer
Size of the cache for the Native MySQL Access.If this parameter corresponds to:
- -2: the size of the cache is the default size (100 for the Native MySQL Access).
- -1: the size of cache is unlimited.
- 0: the cache stores no record. No record is retrieved.
<Connection name>: Character string (with or without quotes)
Name of connection used. This name was defined in the data model editor, or by HDescribeConnection or HOpenConnection.
Modifying the size of the cache for the Native MySQL Access Hide the details
<Connection name>..CtCacheSize = <Cache size>
<Connection name>: Character string (with or without quotes)
Name of connection used. This name was defined in the data model editor, or by HDescribeConnection or HOpenConnection.
<Cache size>: Integer
New size of the cache for the Native MySQL Access.If this parameter corresponds to:
- -2: the size of the cache will be the default size (100 for the Native MySQL Access).
- -1: the size of the cache will be unlimited.
- 0: the cache will store no record. No record will be retrieved.
Remarks
The speed at which the entire set of records is retrieved is proportional to the size of the cache: the larger the cache size, the faster the records are retrieved.
However, the smaller the cache size, the faster the first record will be read.
Caution: The memory used by the cache is proportional to the size of the cache.
Managing the ..CtCacheSize property
..CtCacheSize is supported by the Native MySQL Access.
The other Native Accesses do not support ..CtCacheSize. In this case, the use of this property will be ignored and no error will be generated.
hQueryWithoutCorrection constant
If the query is run and no check is performed on the SQL code (hQueryWithoutCorrection constant), the cache size will be unlimited and it cannot be modified by ..CtCacheSize.