Proxysql: Query cache not working

Created on 5 Sep 2018  路  5Comments  路  Source: sysown/proxysql

I'm trying to put in cache two huge queries.

With SELECT count_star,sum_time,hostgroup,digest,digest_text FROM stats_mysql_query_digest ORDER BY sum_time DESC; i'm able to see the digest for these two queries.

So I did:

INSERT INTO mysql_query_rules (active,digest,cache_ttl,apply) VALUES (1,'0x82796C80785917A6',60000,1);
INSERT INTO mysql_query_rules (active,digest,cache_ttl,apply) VALUES (1,'0xC31128202A53C473',60000,1);
LOAD MYSQL QUERY RULES TO RUNTIME; SAVE MYSQL QUERY RULES TO DISK;

but these queries are still returned from the backend and not from the query cache, as I can see by looking at column hostgroup returned by the SELECT count_star,sum_time,hostgroup,digest,digest_text FROM stats_mysql_query_digest_reset ORDER BY sum_time DESC;

Am I miss something ?

CACHE Feature request

Most helpful comment

I suggest making this information (query cache doesn't support prepared statements) prominent in the readme and in the wiki and FAQ. I just spent an entire day trying to figure out why proxySQL wasn't caching my queries (that's the only reason I wanted to use it) only to find a tiny note at the bottom of one page of the wiki under "limitations".

In addition, obviously, I'd like the query cache to support prepared statements.

All 5 comments

Are you using prepared statements?
If yes, prepared statements aren't supported in Query Cache

I think so , it's a Laravel project and AFAIK it does prepared statement with PDO

Any plans to add support for prepared statement in query cache ?

I suggest making this information (query cache doesn't support prepared statements) prominent in the readme and in the wiki and FAQ. I just spent an entire day trying to figure out why proxySQL wasn't caching my queries (that's the only reason I wanted to use it) only to find a tiny note at the bottom of one page of the wiki under "limitations".

In addition, obviously, I'd like the query cache to support prepared statements.

Is there any chance of this getting attention? Also a laravel user here. There's no easy way to turn off prepared statements even when there are no parameters present in the statement.

As a first step, would it be feasible to cache prepared statements in the case there are no inputs?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andreygolev picture andreygolev  路  20Comments

patrickdk77 picture patrickdk77  路  15Comments

jeniok picture jeniok  路  20Comments

vlanse picture vlanse  路  31Comments

izzyquestion picture izzyquestion  路  15Comments