Home > database >  Analysis and optimization of SQL language, spend a long time.
Analysis and optimization of SQL language, spend a long time.

Time:02-25

Two WHERE conditions has been established btree index,
A query to find out close to one hundred thousand data,


2 be able to find out a data query, need only this one can actually,


But the amount of time is too long, for bosses to help optimize the query time,


CodePudding user response:

Spent 3 seconds, bosses, help to optimize the

CodePudding user response:

CodePudding user response:

If the same data_point_id only a corresponding color, with the top 1 take a record,

If not sure try adding data_pont_id index, query to add an order by null and have a look

CodePudding user response:

Hello World reference 5 floor, response:
if the same data_point_id is determined only by a corresponding color with top 1 take a record,

If not sure try adding data_pont_id index, query to add an order by null see


So, time is 3 seconds,

CodePudding user response:

CodePudding user response:

Hello World reference 5 floor, response:
if the same data_point_id is determined only by a corresponding color with top 1 take a record,

If not sure try adding data_pont_id index, query to add an order by null see


Color is not the only, data points, and the different types of warning colors,

CodePudding user response:

Look at the query plan, use SSMS may give optimization hints

The analysis of the above?

CodePudding user response:

reference 8 floor, the spring would not be old reply:
Quote: Hello World reference 5 floor, response:
if the same data_point_id is determined only by a corresponding color with top 1 take a record,

If not sure try adding data_pont_id index, query to add an order by null see


Color is not the only data points, and the different types of warning colors,

In the index of data_point_id include color column
  • Related