[MDEV-4583] QUERY CACHE - low memory cleanup method Created: 2013-05-26  Updated: 2015-10-29

Status: Open
Project: MariaDB Server
Component/s: Query Cache
Fix Version/s: None

Type: Task Priority: Trivial
Reporter: roberto spadim Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: querycache, querycache_lowmen


 Description   

instead of removing queries from cache with today method, we could create a new method (news methods)

query_cache_clean_method=DEFAULT / PROCEDURE

DEFAULT is today implementation

PROCEDURE will execute some mysql schema stored procedure

since query cache can be veeery big (today i'm using 100MB), maybe procedure will lock query cache a lot, and queries will not hit query cache...
well in this case we could continue with query cache locked, or timeout and get back to default method

add a new global variable: query_cache_clean_timeout= 999999 in seconds, if set to "0" don't timeout

well that's just an idea =) query cache is a nice feature, and, yes, it's not the main function of database / application development/runtime, but it can speed up many things very easly, in other words, a good cache (with very high hit rate) is a performace boost in any system

in coments i will put some ideas from others MDEV (sorry about many comments in others MDEV), that could be procedures or method to remove queries from cache when lowmem



 Comments   
Comment by roberto spadim [ 2013-06-18 ]

please don't close this query cache...
maybe it's a nice 'low memory' solution about query cache
it's not related to prune what will be inserted (label = querycache_insert)
it's not related to control query cache (label = querycache_control)
it's not related to select / query cache hit (label = querycache_result)
it's not related to query cache at client side (label = querycache_client)
it's related to what query cache will do when it get low mem

Comment by roberto spadim [ 2013-06-18 ]

from MDEV-4581

maybe should consider:
1) mean period between hits lower than expend time
2) mean period between hits higher than expend time
3) global mean period between hits (today implemented)

i'm seeing many queries that could be removed because the hit period is bigger than the expend time
in other words... if my query cache remove this query i will have near no user reporting 'system is slow now'

Comment by Daniel Black [ 2015-10-29 ]

rather than define a procedure (which are quite slow) I think you should experiment with a few alternate methods of query cache log memory purging, see how they perform, and see if there is a wider acceptance of those methods. Yes there is a tradeoff between a less used query and a query that took a long time to generate though usually the tradeoff is made at an application level.

Generated at Thu Feb 08 06:57:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.