Home > database >  Article 50 million data quickly query a list one.
Article 50 million data quickly query a list one.

Time:09-21

A table there is id qrcode qrcodesn addtime ischeck
A few fields,

Select the id from qrcode where qrcodesn=sjsjjswjjhr378hsjs

Such good efficiency is low, how to improve the efficiency?

CodePudding user response:

The only index qrcodesn is,

CodePudding user response:

To add a btree index in qrcodesn field try first

CodePudding user response:

reference 1st floor AHUA1001 response:
qrcodesn is that the only index,

Qrxodesn is the only index

CodePudding user response:

reference weixin_44766350 reply: 3/f
Quote: refer to 1st floor AHUA1001 response:
qrcodesn is that the only index,

Qrxodesn is the only index

Index is how slow, good efficiency low mean more, inquire how much time

CodePudding user response:

To a map of an execution plan,

The EXPLAIN
Write here what do you think of slow statement

The above results, screenshots to look at,

CodePudding user response:

reference 4 floor Q446512799 response:
Quote: reference weixin_44766350 reply: 3/f

Quote: refer to 1st floor AHUA1001 response:
qrcodesn is that the only index,

Qrxodesn is the only index

Is the index can slow about it, good efficiency low mean more, query how much time

600 ms this calculate low

CodePudding user response:

600 ms seemed very low ah, you build predicate sentence and execution plan, posted a look

CodePudding user response:

refer to 7th floor Q446512799 response:
600 ms seemed very low ah, your table statements and execution plan, posted to see


To 290000 data, also want to more than 100 milliseconds haha

CodePudding user response:

1000 milliseconds is 1 second, second order reaction also want how? Not all slowing,

CodePudding user response:

Look at your watch, id should be the primary key, is there any indexes on qrcodesn,
In addition
Select the id from qrcode where qrcodesn=sjsjjswjjhr378hsjs
The content of the equal sign behind no quotes, should be an error,
Please build table statements and index, to have a look,
  • Related