Remember once Database Performance Optimization

CPU operating results before optimization:

 

 

Optimized CPU operating results:

 

 

When before optimization App open, you need to load some time.

Optimized App open, seconds to open.

 

The main optimization items are as follows:

Optimization Item 1:

       In the most commonly used vehicle detail page, use very unreasonable to determine whether there is, the list has 370,000 data.

 

 

Optimization Item 2:

       Data Sheet design unreasonable, AKDWeb_APPTokenLog, this very high number of executions, the total number of logical reads is very high table, there is not even an index.

 

 

Optimization Item 3:

       The index added to AKDWeb_APPStore table.

 

 

Annex: time-consuming and performance in gripping SqlServer Sql statement.

SELECT

(Total_elapsed_time / execution_count) / 1000 N 'average time ms'

, Total_elapsed_time / 1000 N 'total time spent ms'

, Total_worker_time / 1000 N 'total CPU time used ms'

, Total_physical_reads N 'total number of physical read'

, Total_logical_reads / execution_count N 'read cycles each logical'

, Total_logical_reads N 'reads the total number of logical'

, Total_logical_writes N 'writes the total number of logical'

, Execution_count N 'number of execution times'

,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,

((CASE statement_end_offset

WHEN -1 THEN DATALENGTH(st.text)

ELSE qs.statement_end_offset END

- qs.statement_start_offset) / 2) + 1) N 'execute the statement'

, Creation_time N 'statement compilation time'

,last_execution_time N'上次执行时间'

FROM

sys.dm_exec_query_stats AS qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st

WHERE

SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,

((CASE statement_end_offset

WHEN -1 THEN DATALENGTH(st.text)

ELSE qs.statement_end_offset END

- qs.statement_start_offset)/2) + 1) not like '�tch%'

ORDER BY

total_elapsed_time / execution_count DESC;

 

转载于:https://www.cnblogs.com/ushou/p/8044517.html

Guess you like

Origin blog.csdn.net/weixin_33811961/article/details/93162622