skip to main content
Configuring the OpenAccess SDK SQL Engine : Configuring Row Cache
 

Configuring Row Cache

Each query that is processed maintains a cache of row and value nodes to handle the query results. The row nodes are allocated as one large memory block and memory is split into row node and added to the row cache.
ServiceSQLResultCacheRowBlockSize is the number of ROW nodes allocated as one large memory block. Similarly, ServiceSQLResultCacheValBlockSize is the number of VALUE nodes allocated as one large memory block. This allows fewer memory allocations to be done to process query results.
When dam_allocRow is called, a row from the cache of row nodes is used. When dam_freeRow is called, the row is returned back to the cache. The row is also returned back to the cache when results are returned to client application.
If the cache is empty, another memory block is allocated for ServiceSQLResultCacheRowBlockSize row nodes. Typically, in cursor mode with no post-processing, even a large query will be processed using just one memory allocation for ServiceSQLResultCacheRowBlockSize row nodes.
If you expect the application to use a large value for ServiceSQLFetchBlockSize and want to avoid allocating large memory blocks, use a smaller value for ServiceSQLResultCacheRowBlockSize so that multiple blocks will be allocated to handle ServiceSQLFetchBlockSize records.
The value node cache is used when the IP calls dam_addValToRow to provide column values. When the row is freed, all value nodes of that row are returned back to value node cache. When the query is fully processed, the entire cache of row and value nodes is freed.
In the default configuration, the OpenAccess SQL engine sets the ServiceSQLResultCacheRowBlockSize and ServiceSQLResultCacheFetchBlockSize to the same value, and sets ServiceSQLResultCacheValBlockSize to be ten times the value of ServiceSQLResultCacheRowBlockSize. If you want your IP code to tune these values, set the ServiceSQLResultCacheRowBlockSize, ServiceSQLResultCache, and ServiceSQLResultCacheValBlockSize configuration parameters using the OpenAccess SDK Management Console.