Cache all SELECTs with ProxySQL

1.7k views Asked by At

I spent a couple of hours setting up ProxySQL to cache all selects, but there is no hit on the query rule. Rule is set up this way:

rule_id = 1
active = 1
match_pattern = ^SELECT(.*)$
cache_ttl = 3600000
apply = 1
destination_hostgroup = 36

All other variables are NULL or 0, connection thru ProxySQL goes well, rules are loaded into the runtime. I have only one backend server.

Anyone has an idea?

2

There are 2 answers

1
LordMagik On

Match pattern changed to

SELECT .*

and it works.

1
bounav On

According to proxysql's read-write howto, setting

match_pattern = ^SELECT

should work.

The ^SELECT regular expression will match "any query digest starting with SELECT".