How the Php+mysql site reduces the number of linked databases
There is a website that needs to be displayed on the home page
Newly added items
Last Updated items
The most searched items
Recently searched items
A kind of goods that sell the most
Most of the items of type B are sold.
The specified item
Specially designated items
The above query is for the same table. This table has a very large number of records, and the table has a lot of field content. If each query is executed once. The CPU usage of the server is very high. Several people will be slow to access the refresh at the same time.
Is there any caching technology that can be used. Just contact PHP is not particularly well understood. Expect expert answers
------Solution--------------------
Http://zhidao.baidu.com/question/73543180.html
I don't know if this is what you're looking for.
No, I didn't actually write it.
------Solution--------------------
is PHP Memcached helpful to you? I have not used myself, is considering the system of learning about Memcached.
------Solution--------------------
Caches the results of an operation in memory or after serialization is saved in a file
If the newly added item is written into the cache file at the same time in the Insert Table Operation home Page Direct Read cache
Consider whether the update is very frequent and very frequent, the proposed sub-table
------Solution--------------------
Caching technology is the savior of the database. Memcache is a good choice. Easy to install and use
------Solution--------------------
About caching Technology (MemCached)
You can refer to the following two cases, it will certainly help you: http://www.php100.com/html/shipinjiaocheng/PHP100shipinjiaocheng/2010/0125/3856.html
Http://www.php100.com/html/shipinjiaocheng/PHP100shipinjiaocheng/2010/0201/3897.html
------Solution--------------------
Memcache is one aspect.
Landlord needs, you can do a decomposition of the table. Don't all target a single table, and it doesn't make sense to target a single table. If you want to associate a query, then write the associated content directly into the target table, not associated.
Suppose the commodity table is goods
Latest Added Items shopping cart table cart
Last updated item Shopping cart table Cart
Most searched items search Form Searchlog
Recently searched item search Form Searchlog
A kind of goods sold in the most sales table sold
The most sales form sold in the category B items sold
List of items specified topads
Specially specified item top list topads
--there is a general meaning in it. You can create the cart table by creating a field Goods_title store the name of the goods.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.