Simple test of performance impact when PHP inserts a record into mysql and does not output each result _ MySQL

Source: Internet
Author: User
Simple test: performance impact when PHP inserts a record into mysql and when each result is not output. here we use 100 records and records to insert an experiment to see whether there is an output or no output impact when inserting.

Table structure

Field Type Null Default Note
Id Int (11) No
Name Char (50) No
Pwd Varchar (255) No
Ptime Bigint (20) No
State Int (11) No

Insert 10000 entries

Output time consumption: 256 S concurrency: 39/S

No output time consumption: 230 S concurrency: 43/S

Insert 100 entries

Output time consumption: 1.656 S concurrency: 60.386/S

No output Time: 1.547 S concurrency: 64.641/S


A simple test shows that it is not necessary to output the result information when executing SQL statements in batches. check the results after all SQL statements are executed.

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.