Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4671

QUERY CACHE - black list

    XMLWordPrintable

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

          Activity

            People

              Unassigned Unassigned
              rspadim roberto spadim
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.