PHP reads more than 1000 pieces of product data, which is slow. how can this problem be solved?

Source: Internet
Author: User
PHP reads more than 1000 pieces of product data, which is slow. I am a newbie, but I am not familiar with PHP for a long time. The problem I want to solve now is: I have a system, there are more than 1000 product data in it. each time the product list is displayed, it takes a long time for the browser to load that page. I have taken pagination display. In this case, the purchase order shows that several tables are combined with PHP to read more than 1000 pieces of product data, which is slow.
I am a newbie and have not been familiar with PHP for a long time. now I want to solve the problem: I have a system with more than 1000 product data. each time I display the product list, it will take a long time for the browser to load that page. I have taken pagination display. In this case, the purchase order is displayed. in this case, several tables are associated for query, so the time is slower. Do you have any suggestions?

------ Solution --------------------
To query the fields, create a joint index for these fields.
Discussion

Reference:

There are no more than 1000 pieces of data. check whether the table Association is redundant, or add an index to the columns that are frequently queried or associated.

I only have a primary key index, but nothing else.

------ Solution --------------------
In addition, we suspect that your paging mechanism is not "real paging", but to search 1000 completely read "fake pages" in this version, there are many examples of real paging .... each time the read content is reduced, it will be fine.
------ Solution --------------------
Execute the EXPLAIN statement for complex query expressions, which will give you useful suggestions.
You cannot guess by yourself. reducing the associated tables at will may result in inaccurate query results.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.