Mr. Yeopto, I am uploading the result file.

Asked 2 years ago, Updated 2 years ago, 37 views

Query 1

Query 2

CREATE TABLE `Basic12MFW1D` (
   `code` longtext,
   `name` longtext,
   `ChangeOP` double DEFAULT NULL,
   `ChangeNP` double DEFAULT NULL,
   `ChangeOPM` double DEFAULT NULL,
   `ChangeROE` double DEFAULT NULL,
   `ChangeSales` double DEFAULT NULL,
   `year` int(11) DEFAULT NULL,
   `month` int(11) DEFAULT NULL,
   `day` int(11) DEFAULT NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8

This is.

r mysql

2022-09-22 18:09

1 Answers

It seems certain that there are no indexes in the table at all. So of course it's slow. Because it's a situation similar to finding the sentence you want in a book that doesn't have table of contents ("index").

When people search for books without a table of contents, they search for places that they think are "not here no matter how much." But without that, the database looks for sentences by opening, reading, passing, opening, reading, and passing from page one. That's why it's slow. If you want to pass year, month, day that you don't need, you should specify and organize the table of contents for year, month.

Actually, I think you should get help from people who know DB better than me from here. Put a lock on the table, and just enough CREATE INDEX... This is because you need to add an index by using the ON Basic12MFW1D command. The indexing strategy is... I'm not sure about the DB, so I have to pass it.


2022-09-22 18:09

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.