Query Cache: Does a SELECT query tagged with SQL_NO_CACHE really touch the QC mutex?
Hello, I found the query cache in MariaDB to be super useful and especially powerful when used in DEMAND mode. So I'd like to learn more about the performance characteristics. The documentation says that for the query cache, "the mutex is hit even for SQL_NO_CACHE": https://mariadb.com/kb/en/mariadb-memory-allocation/#query-cache Is there some more information about this somewhere? Why would a SELECT query that uses this directive dabble with the mutex at all?
Hi, hellomaria-letmetrythisfirst---, On Dec 20, hellomaria-letmetrythisfirst--- via discuss wrote:
Hello,
I found the query cache in MariaDB to be super useful and especially powerful when used in DEMAND mode. So I'd like to learn more about the performance characteristics.
The documentation says that for the query cache, "the mutex is hit even for SQL_NO_CACHE":
https://mariadb.com/kb/en/mariadb-memory-allocation/#query-cache
Is there some more information about this somewhere?
The above is incorrect. Queries with SQL_NO_CACHE will not take query cache mutex. They used to, but it was fixed more than 10 years ago. I've removed that claim from the manual, thanks for pointing it out. Regards, Sergei Chief Architect, MariaDB Server and security@mariadb.org
Awesome, thanks! And how about this statement: "The QC, unless it is OFF & 0, is consulted for _every_ SELECT" When "query_cache_type=DEMAND", I would expect that the mutex is only accessed for queries that are tagged with "SQL_CACHE"?
Hi, hellomaria-letmetrythisfirst---, On Dec 23, hellomaria-letmetrythisfirst--- via discuss wrote:
Awesome, thanks!
And how about this statement: "The QC, unless it is OFF & 0, is consulted for _every_ SELECT"
When "query_cache_type=DEMAND", I would expect that the mutex is only accessed for queries that are tagged with "SQL_CACHE"?
Query cache is consulted before the query is parsed. That is, before it knows if there is SQL_CACHE in your SELECT or not. Regards, Sergei Chief Architect, MariaDB Server and security@mariadb.org
participants (2)
-
hellomaria-letmetrythisfirst@mailinator.com
-
Sergei Golubchik