Use MySQL built-in functions to handle the results or take them out and handle them again.

Source: Internet
Author: User
MySQL also has a rich string processing function, although not all but enough.
I want to ask, when I fetch the data, it is finished with MySQL and then taken out or left intact to the PHP to do the follow-up processing.
What are the pros and cons of both performance?

Reply content:

MySQL also has a rich string processing function, although not all but enough.
I want to ask, when I fetch the data, it is finished with MySQL and then taken out or left intact to the PHP to do the follow-up processing.
What are the pros and cons of both performance?

The problem of the Lord can be extended more broadly, whether it is MySQL, or SQL Server,oracle will encounter problems like the main problem.

First of all, my answer: there is no better way to say that, both approaches have their own usage scenarios.

One, the SQL statement to write stored procedures (store procedure, hereinafter referred to as SP) to process the data

  • Benefits: Quick
  • Cons: Difficult to maintain, database migration what to go with the SP
  • Application scenario: If the data size is huge, be sure to write the SP. I was in the Microsoft Internship, my team is to do bi, the data volume is large, processing all go sp. NET this layer is only responsible for passing the data.

Second, the data query to the back-end processing

  • Benefits: Easy Maintenance
  • Cons: Relatively direct use of SP slower
  • Scenario: If the amount of database data is small, there is not much difference between using SP.

You make a system to know where the bottleneck is . If the bottleneck is a large amount of data and the query is slow, then optimize the database block and write the SP. If the amount of data is small, the bottleneck of the system is definitely elsewhere, such as slow network transmission.

PHP processing .... mysql can save the province ....

MySQL's responsibility is to get the maximum possible results out of the fastest speed.

  • Related Article

    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.