Home > database >  Essentially a query speed
Essentially a query speed

Time:11-02

Consult everybody:
I made a collection, data storage, database, a second collection, with date time field,
In order to speed up the query speed, whether I can put the date time field is defined as a clustered index? Because the query is mainly the where time is greater than the less than, is likely to have the same record time,
The same date, when the minutes (a second one data, possible time, then may modify system time, so it's possible date/time), so you can't build a primary key,
This is not set up the primary key, influential to query speed? In order to speed up the query, you have any Suggestions?

CodePudding user response:

Can put the date/time field is defined as a clustered index, if reading and writing is frequent, queries can add nolock, read and write or separation, the uniqueness of the primary key is mainly used for business key, the necessity of some high availability, use the primary key

CodePudding user response:

Now that there is no primary key line, but still suggest or build, who did know what place need to use, after all, it is the "primary key",

1 1 second operating frequency, the dare not speak, learn a lesson by himself,
  • Related