Setting the statement cache  Statement matching criteria

Chapter 1: The Statement Cache

Ad hoc query processing

Adaptive Server performs the following steps to process ad hoc SQL statements using the statement cache:

  1. Adaptive Server parses the statement.

    If the statement should be cached (see “Caching conditions”), Adaptive Server computes a hash value from the statement. Adaptive Server uses this hash value to search for a matching statement in the statement cache (see “Statement matching criteria”).

  2. Adaptive Server caches the SQL statement text.

  3. Adaptive Server wraps the SQL statement with a lightweight stored procedure and changes any local variables into procedure parameters. The internal representation of the lightweight procedure is not yet compiled into the plan.

  4. Adaptive Server converts the SQL statement into an execute statement for the corresponding lightweight procedure.

  5. Adaptive Server then executes the procedure.





Copyright © 2004. Sybase Inc. All rights reserved. Statement matching criteria

View this book as PDF