Oracle 5.0 Reference Manual page 725

Table of Contents

Advertisement

The query cache works for
is returned by a following
value even if the preceding query was fetched from the cache because the number of found rows is
also stored in the cache. The
A query cannot be cached if it contains any of the functions shown in the following table.
BENCHMARK()
CURDATE()
CURRENT_TIMESTAMP()
ENCRYPT()
parameter
LAST_INSERT_ID()
[926]
NOW()
[967]
SLEEP()
[964]
USER()
A query also is not cached under these conditions:
• It refers to user-defined functions (UDFs) or stored functions.
• It refers to user variables or local stored program variables.
• It refers to tables in the
• It is of any of the following forms:
SELECT ... LOCK IN SHARE MODE
SELECT ... FOR UPDATE
SELECT ... INTO OUTFILE ...
SELECT ... INTO DUMPFILE ...
SELECT * FROM ... WHERE autoincrement_col IS NULL
The last form is not cached because it is used as the ODBC workaround for obtaining the last insert
ID value. See the Connector/ODBC section of
Statements within transactions that use
cached because they use
• It was issued as a prepared statement, even if no placeholders were employed. For example, the
query used here is not cached:
char *my_sql_stmt = "SELECT a, b FROM table_c";
/* ... */
mysql_stmt_prepare(stmt, my_sql_stmt, strlen(my_sql_stmt));
See
Section 20.6.7, "C API Prepared
• It uses
TEMPORARY
• It does not use any tables.
• It generates warnings.
• The user has a column-level privilege for any of the involved tables.
8.6.3.2. Query Cache
Two query cache-related options may be specified in
The MySQL Query Cache
SELECT SQL_CALC_FOUND_ROWS ...
SELECT FOUND_ROWS()
SELECT FOUND_ROWS()
[957]
CONNECTION_ID()
[918]
CURRENT_DATE()
[918]
CURTIME()
[955]
with one
FOUND_ROWS()
[961]
LOAD_FILE()
RAND()
SYSDATE()
UUID()
or
mysql
INFORMATION_SCHEMA
LOCK IN SHARE MODE
tables.
Options
SELECT
query.
FOUND_ROWS()
query itself cannot be cached.
[959]
[918]
[918]
[960]
[890]
[912]
[928]
[967]
system database.
Chapter 20, Connectors and
[1121]
SERIALIZABLE
locking.
Statements".
statements:
SELECT
705
queries and stores a value that
[960]
returns the correct
[918]
CONVERT_TZ()
CURRENT_TIME()
[960]
DATABASE()
[965]
GET_LOCK()
MASTER_POS_WAIT()
RELEASE_LOCK()
UNIX_TIMESTAMP()
with no parameters
APIs.
isolation level also cannot be
[918]
[966]
[967]
[931]

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents