[MDEV-6890] query cache, only invalidate when table change Created: 2014-10-18 Updated: 2015-11-17 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Query Cache |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | roberto spadim | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
hi guys... well again query cache... check this...
i didn't checked how each engine remove queries from query cache, but... should it only remove queries from query cache, if one+ row(s) change? this reduce table invalidation, increase query cache hit idea of this MDEV: create a 'delayed' query cache invalidation, in other words, instead of invalidating when one UPDATE/DELETE/INSERT occur, only invalidate if one row changed, ok this is a problem with transactions where we don't know if it should or not be invalidated outside transaction, but, if update/delete don't change anything, why should it invalidate query cache? — |
| Comments |
| Comment by Sergei Golubchik [ 2014-11-07 ] | |||||||||||
|
I suspect it's just not worth the troubles. Like, how often UPDATE will leave the table unchanged? | |||||||||||
| Comment by roberto spadim [ 2014-11-07 ] | |||||||||||
|
Hi Sergei! i didn't read a lot about the source code to give many help, i checked the "user side" of query cache only maybe instead of invalidate the table from query cache at first update/delete/insert, we could "lock" the query cache table (something like exclusive lock) and if a new select execute, it will not return to client using query cache cause the table used with the cached query is 'locked' something like:
this add more cpu cicles and increase a bit memory consume (each query cache table must have a lock information now) i think it's a nice feature to increase hit rate, it reduce some possible table invalidation (good), but increase cpu cicles while getting query from cache (bad), the mix of good/bad i think we could leave to user/developer/dba | |||||||||||
| Comment by roberto spadim [ 2014-11-07 ] | |||||||||||
|
sorry many rewrite.... i was thinking about 2 updates (or two transactions)
and
| |||||||||||
| Comment by roberto spadim [ 2014-11-07 ] | |||||||||||
|
"I suspect it's just not worth the troubles. Like, how often UPDATE will leave the table unchanged?" sorry, now i looked the problem... |