/* Get the actual SQL statement for this query cache query */
statement_text = (constchar*)query_cache_query->query();
statement_text_length = strlen(statement_text); /* We truncate SQL statements up to MAX_STATEMENT_TEXT_LENGTH in our I_S table */
table->field[COLUMN_STATEMENT_TEXT]->store((char*)statement_text,
MY_MIN(statement_text_length, MAX_STATEMENT_TEXT_LENGTH), scs);
/* get the entire key that identifies this query cache query */
key = (constchar*)query_cache_query_get_key(query_cache_block_raw,
&key_length, 0); /* get and store the flags */
flags_length= key_length - QUERY_CACHE_FLAGS_SIZE;
memcpy(&flags, key+flags_length, QUERY_CACHE_FLAGS_SIZE);
table->field[COLUMN_LIMIT]->store(flags.limit, 0);
table->field[COLUMN_MAX_SORT_LENGTH]->store(flags.max_sort_length, 0);
table->field[COLUMN_GROUP_CONCAT_MAX_LENGTH]->store(flags.group_concat_max_len, 0);
/* The database against which the statement is executed is part of the querycachequerykey
*/
compile_time_assert(QUERY_CACHE_DB_LENGTH_SIZE == 2);
db= key + statement_text_length + 1 + QUERY_CACHE_DB_LENGTH_SIZE;
db_length= uint2korr(db - QUERY_CACHE_DB_LENGTH_SIZE);
set_if_smaller(db_length, (size_t)(key + key_length - QUERY_CACHE_FLAGS_SIZE - db));
/* If we have result blocks, process them */
first_result_block= query_cache_query->result(); if(query_cache_query->is_results_ready() &&
first_result_block)
{ /* initialize so we can loop over the result blocks*/
result_block= first_result_block;
result_blocks_count = 1;
result_blocks_size = result_block->length;
result_blocks_size_used = result_block->used;
/* loop over the result blocks*/ while((result_block= result_block->next)!=first_result_block)
{ /* calculate total number of result blocks */
result_blocks_count++; /* calculate total size of result blocks */
result_blocks_size += result_block->length; /* calculate total of used size of result blocks */
result_blocks_size_used += result_block->used;
}
} else
{
result_blocks_count = 0;
result_blocks_size = 0;
result_blocks_size_used = 0;
}
table->field[COLUMN_RESULT_BLOCKS_COUNT]->store(result_blocks_count, 0);
table->field[COLUMN_RESULT_BLOCKS_SIZE]->store(result_blocks_size, 0);
table->field[COLUMN_RESULT_BLOCKS_SIZE_USED]->
store(result_blocks_size_used, 0);
if (schema_table_store_record(thd, table)) goto cleanup;
}
status = 0;
maria_declare_plugin(query_cache_info)
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
&qc_info_plugin, "QUERY_CACHE_INFO", "Roland Bouman, Daniel Black", "Lists all queries in the query cache.",
PLUGIN_LICENSE_BSD,
qc_info_plugin_init, /* Plugin Init */ 0, /* Plugin Deinit */ 0x0101, /* version, hex */
NULL, /* status variables */
NULL, /* system variables */ "1.1", /* version as a string */
MariaDB_PLUGIN_MATURITY_STABLE
}
maria_declare_plugin_end;
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.15Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.