Chapter 1: The Statement Cache  Ad hoc query processing

Chapter 1: The Statement Cache

Setting the statement cache

The statement cache allows Adaptive Server to store the text of ad hoc SQL statements. Adaptive Server compares a newly received ad hoc SQL statement to cached SQL statements and, if a match is found, uses the plan cached from the initial execution. In this way, Adaptive Server does not have to recompile SQL statements for which it already has a plan.

The statement cache is a server-wide resource, which allocates and consumes memory from the procedure cache memory pool. Set the size of the statement cache dynamically using the statement cache size configuration parameter. The syntax is:

sp_configure "statement cache size", size_of_cache

where size_of_cache is the size, in 2K pages. For example, to set your statement cache to 5000 2K pages, enter:

sp_configure "statement cache size", 5000

See “statement cache size configuration parameter” for more information.

Consider the following when you configure memory for the statement cache:





Copyright © 2004. Sybase Inc. All rights reserved. Ad hoc query processing

View this book as PDF