Home > database >  The same table, why the mysql slower than used to so much
The same table, why the mysql slower than used to so much

Time:11-29

Make a data table stock, line, about 16 million records, want to do the data analysis,
Win10 pro, SSD, 8 gb of memory, with sqlserver2016 and mysql 8.0.20,
Table structure is as follows:
The CREATE TABLE rx (
Sc char (2) NOT NULL,
Code char (6) NOT NULL,
Dt int the NOT NULL,
Popen int the NOT NULL,
Phigh int the NOT NULL,
Plow int the NOT NULL,
The pclose] int the NOT NULL,
Amount, float the NOT NULL,
Volume decimal (14) NOT NULL,
Lastclose int the NOT NULL
)
Perform a simple query:
Select count (*) from rx where pclose> 1000
Essentially is about 0.14 seconds
Mysql is about 7.8 seconds

Doubt is the cause of the mysql takes up too much memory, then built a temporary table, pour the rx to the temporary table, perform the same query, about 6.5 seconds,

Unconvinced, then pour the data to mysql on a Linux machine, the machine also the SSD drive, 8 gb of memory, CPU is slightly less, execute down to about 3.5 seconds,

The query of the case is a full table search, don't do optimization,
Mysql query performance of this food?

CodePudding user response:

Table structure by mistake, should be the pclose int the NOT NULL,

At the back of the] write post forget delete
  • Related