PHP Order Data Analysis issues

Source: Internet
Author: User
As time goes on, the list of data in the order table will be more and more, it will need to one months or a quarter or even nearly a year of data analysis statistics, such as the refund rate, payment rate, as well as the products associated with the order related parameters, but such a real-time calculation of the consequences of either a timeout, or memory overflow, Ask for such a problem with PHP solution.

Reply content:

As time goes on, the list of data in the order table will be more and more, it will need to one months or a quarter or even nearly a year of data analysis statistics, such as the refund rate, payment rate, as well as the products associated with the order related parameters, but such a real-time calculation of the consequences of either a timeout, or memory overflow, Ask for such a problem with PHP solution.

For the data before the day, can be collected and processed daily, stored in the database, space for time, so that the real-time data also only need to check the day, the efficiency will be much higher, the pressure on the server will be greatly reduced, you can also do a cache to prevent frequent user refresh pressure

The problem is broad and essentially not related to language, but in general it can start at two.

    1. Set up an offline library, your query to go offline library check, do not go to the main library to query (by exporting data or the decision depends on your specific situation)

    2. For some often needed data, design one or more data analysis tables, according to the dimensions you need to run once, the historical data as long as the beginning of the run is good, after you only need to run the new data to analyze

There is a further need to introduce some other tools (such as ES, Hadoop, etc.) and even to redesign the shape of your data analysis-related products

You can set up a summary table, the statistical information is written into the summary table, and then directly query the summary table, anyway, statistics is the form of the month or quarter

    • Run the script in CLI mode, do not FPM

    • The yield keyword is used in the loop, and no extra intermediate variables are generated

  • 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.