Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
We could implement a black list to query cache
SELECT * FROM schema.table
|
an idea is a "mysql.query_cache_deny_tables" table with four columns:
SCHEMA varchar(64),
|
TYPE enum ('=','LIKE')
|
TABLE varchar(255)
|
PARTITION varchar(255)
|
PRIMARY KEY (SCHEMA,TYPE,TABLE,PARTITION) BTREE (usefull with LIKE)
|
we could check if table being cache is inside this table with 2 queries:
1) type="="
SELECT 1 |
FROM mysql_query_cache_deny_tables |
WHERE |
SCHEMA="#table_schema#" AND |
TYPE="=" AND |
TABLE_LIKE IN ("#table_name#","") AND |
PARTITION IN ("#partition#",'') |
LIMIT 1
|
2) type="LIKE"
SELECT 1 |
FROM mysql_query_cache_deny_tables |
WHERE |
SCHEMA="#table_schema#" AND |
TYPE="LIKE" AND |
"#table_name#" LIKE TABLE AND |
"#partition_name#" LIKE PARTITION |
LIMIT 1
|
if this query return any rows we discart the query cache
table ="" => don't cache any table from this SCHEMA,
partition ="" => table without partitions or all partitions of this table
obvious more rows inside this table = slower query cache, must check what's fast, a "table "LIKE field, or a hash table with many "=" conditions and no "like" condition
maybe we could add two others types: "!=" and "NOT LIKE"
Attachments
Issue Links
- relates to
-
MDEV-6358 QUERY CACHE - Ignore Table List
- Open