Title
Read a lot of information on the Internet is mostly about memcache configuration installation and Function list
It is now configured to use echo $memcache->getversion () or to print out the version.
How to do further operation to increase the response speed
For example, I now know that a very complex SQL statement takes a long time to execute.
How do I work with this SQL statement?
If the description is not clear please say I try to describe ...
Thank you ~
Reply to discussion (solution)
I guess you think you're wrong about the application scenario ...
The problem with SQL first is the optimization statement
Of course, you might consider putting the table in a temporary memory table to handle
Title
Read a lot of information on the Internet is mostly about memcache configuration installation and Function list
It is now configured to use echo $memcache->getversion () or to print out the version.
How to do further operation to increase the response speed
For example, I now know that a very complex SQL statement takes a long time to execute.
How do I work with this SQL statement?
If the description is not clear please say I try to describe ...
Thank you ~
Memcache can share the pressure of MySQL.
For example, if you have a SELECT Read statement to execute, read from the memcache cache each time you read the database, read from MySQL, and write the content to the cache for the next read from the cache.
Memcache plainly can reduce the read pressure of the database service, but also is the cache, read fast and low pressure.
And "For example I now know that a very complex SQL statement executes for a long time", if you want to make it fast you can only optimize the SQL statement.
If this is a read operation, then you can write the cache, and later read the words very quickly.
In addition, the cache should be aware that the cache is updated when the database updates and delete. ~~~
Of course, optimizing as much as possible is the first thing to consider.
And now we're going to do the cache, hopefully faster.
So do you want to set the or (and) get at each query?
Wouldn't that be very tedious.
Memcache can not relieve the pressure of the database
If that is going to put the query results in memcache for the next use, then the next time you get is not always the old data?
If you want to check if the data in the library is updated, what do you want to do with caching?
So what kind of scene is memcache fit for?
When your program is already using a file or database cache intermediate results, using Memcache can improve cache performance
Memcache can not relieve the pressure of the database
If that is going to put the query results in memcache for the next use, then the next time you get is not always the old data?
If you want to check if the data in the library is updated, what do you want to do with caching?
So what kind of scene is memcache fit for?
When your program is already using a file or database cache intermediate results, using Memcache can improve cache performance
Can you give a slightly specific example to illustrate the application of the memcache?
===========
I am now looking for a user's attention to a variety of information. To check the summary of the various conditions and then go to the information matrix query. Is it appropriate to use memcache in this case (to cache summary results for various conditions, set an expiration time)?
The cache is primarily applied to pages or programs that do not update for a certain time period and are frequently connected to the database, such as the weather forecast, the daily promotion page of the mall, and so on, which are relatively large and not long to update using the cache time limit, such as 8 per day update or a few time periods, to see their own needs
Title
Read a lot of information on the Internet is mostly about memcache configuration installation and Function list
It is now configured to use echo $memcache->getversion () or to print out the version.
How to do further operation to increase the response speed
For example, I now know that a very complex SQL statement takes a long time to execute.
How do I work with this SQL statement?
If the description is not clear please say I try to describe ...
Thank you ~
Memcache can share the pressure of MySQL.
For example, if you have a SELECT Read statement to execute, read from the memcache cache each time you read the database, read from MySQL, and write the content to the cache for the next read from the cache.
Memcache plainly can reduce the read pressure of the database service, but also is the cache, read fast and low pressure.
And "For example I now know that a very complex SQL statement executes for a long time", if you want to make it fast you can only optimize the SQL statement.
If this is a read operation, then you can write the cache, and later read the words very quickly.
In addition, the cache should be aware that the cache is updated when the database updates and delete. ~~~
Elder sister is to do PHP?
Of course, optimizing as much as possible is the first thing to consider.
And now we're going to do the cache, hopefully faster.
So do you want to set the or (and) get at each query?
Wouldn't that be very tedious.
When your program is already using a file or database to cache intermediate results, then using memcache can improve the performance of the cache without reading the words
Memcache can not relieve the pressure of the database
If that is going to put the query results in memcache for the next use, then the next time you get is not always the old data?
If you want to check if the data in the library is updated, what do you want to do with caching?
So what kind of scene is memcache fit for?
When your program is already using a file or database cache intermediate results, using Memcache can improve cache performance
When your program is already using a file or database cache intermediate results, using Memcache can improve cache performance
That's not a word to read.
Plainly memcache is a memory caching technique, which is a caching method, which depends on the situation to use.
For frequent reads, high repetition rate per read, low data update frequency, Memcache can optimize your system response speed.
In general, the use of memcache is divided into several steps:
1. In code, instantiate the Memcache object
$mem = new Memcache;
$mem->addserver (' 127.0.0.1 ', 11211);
2, after obtaining the data, the data is cached to Memcache, the following example $data is the data that needs to be cached, $key can be considered as the unique identity of memcache cache data
$mem->add ($key, $data, memcache_compressed,60);
3, in the need of data, from the memcache inside according to $key fetch data
$val = $mem->get ($key);
You say that memcache is not used to optimize SQL statements,
It is used to temporarily store the data obtained after accessing the database, the first time to obtain data storage, the next time you do not need to query the database, but directly from the memory, so as to reduce the database access pressure.
And Memcache is equivalent to an object-oriented access interface (a procedural procedure for memory caching)
A logic like this in code
if ($mem->get (' key ')) {//Determine if it has been stored
Stored from in-memory fetch
}else{
$mem->set (' key ', ' value ')//not yet stored in cache
}
Just a simple call to this, or very simple, try it yourself.
Configuration is not obvious.