MySQL and PostgreSQL small pk

Source: Internet
Author: User
Tags postgresql

General additions and deletions to search

The table structure and data are extremely simple, and the naming is also not fastidious. Is the default configuration, MySQL table default InnoDB engine. Table x contains three int fields a B c,100w data are a=1 b=2 c=3

SQL statements

Build table:

Create Table int int int);

Insert data (Import from text):

--MySQL
Loadintotable x;
--PG
From ' Data.txt ';

Querying data

Select *  from where = 2;

Update data:

Update Set = 4 where = 2;

Delete data:

Delete  from X;
Data comparison
Mysql Pg Contrast
insertx100w 2.8~3.5s 500~600ms PG Speed is MYSQL5 times
Select 250ms 63ms PG Speed is MYSQL4 times
Update 370ms 78ms PG Speed is mysql4.7 times
Delete 4~5s 1.8~2.5ms PG Speed is MYSQL2 times

Not finished ... "may" be continued (more level of comparison) ...

MySQL and PostgreSQL small pk

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.