MySQL Caches
#1

Hi, is it important to delete caches? The only thing that confuses me about MySQL right now are the caches. Are there any tutorials about that or can someone be so kind and tell me about caches? Like what are they even for? I heard they are stored in the memory or something. I looked at the MySQL's website, but that didn't really help me.
Reply
#2

As far as i know, you should ad must delete them, as they can somehowbe used to hack your database (i amnot saying it onmy own).

The so called hijacking thing through inputs.
Reply
#3

Quote:
Originally Posted by iLearner
Посмотреть сообщение
As far as i know, you should ad must delete them, as they can somehowbe used to hack your database (i amnot saying it onmy own).

The so called hijacking thing through inputs.
That's SQL injection. That happens when you don't escape strings.
Reply
#4

Cache is something similar then.
Reply
#5

http://dev.mysql.com/doc/refman/5.7/en/query-cache.html

If you use non-threaded queries(1) or save the cache for later use(2), then yes - you need to remove the cache from the memory to avoid memory leaks.

(1)SELECT or INSERT (with auto increment to retrieve) queries.
(2)cache_save() function saves the result in memory and we can set it as active cache later on and retrieve the data. Afterwards, it is not used anywhere else so cache_remove() which also unsets the cache after deleting.
Reply
#6

But threaded queries don't save cache unless I save it, am I right?
Reply
#7

They do use cache but it is deleted automatically after the code of the specified callback is executed (finished). I supposed that for those queries that do not specify a callback, it is deleted right after the execution.
Reply
#8

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
http://dev.mysql.com/doc/refman/5.7/en/query-cache.html

If you use non-threaded queries(1) or save the cache for later use(2), then yes - you need to remove the cache from the memory to avoid memory leaks.

(1)SELECT or INSERT (with auto increment to retrieve) queries.
(2)cache_save() function saves the result in memory and we can set it as active cache later on and retrieve the data. Afterwards, it is not used anywhere else so cache_remove() which also unsets the cache after deleting.
Just a question about (1), how can I delete the cache saved after auto increment retrieval ?
Since in usual I need result id
Reply
#9

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
If you use non-threaded queries
That's not true. I have never used threaded queries and there was no memory leaks on my servers.
Cache is always deleting by self, you only need to delete it when you use cache_save.
Reply
#10

Quote:
Originally Posted by Rdx
Посмотреть сообщение
That's not true. I have never used threaded queries and there was no memory leaks on my servers.
Cache is always deleting by self, you only need to delete it when you use cache_save.
What makes you think the person who maintains the plugin would write false claims in the wiki page for?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)