sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
6.06k stars 983 forks source link

Support some form of partial cleanup of `stats_mysql_query_digest` #4543

Open renecannao opened 6 months ago

renecannao commented 6 months ago

A potential new feature.

Introduce some new command in Admin to delete from stats_mysql_query_digest old entries. For example, something like: PURGE stats_mysql_query_digest TO <value>

Any entry in stats_mysql_query_digest where last_seen is less than <value> will be deleted.

The process needs to be synchronous, thus will block the internal hash table while the process is running. As an optimization, we can use parallel processing as we already do in many tasks related to stats_mysql_query_digest.