SQL Server memory consumption high processing mode

Source: Internet
Author: User
Tags server memory

Https://www.cnblogs.com/srsrd/p/6962982.html

Method One:

Method Two:

Use the following statement to find out what statements account for the highest memory and optimize for statements that account for high memory
SELECT SS. Sum_execution_count,
T.text,
Ss. Sum_total_elapsed_time as ' Sum time ',
Ss. Sum_total_worker_time as ' execution time ',
Ss. Sum_total_logical_reads as ' sum logical readings ',
Ss. Sum_total_logical_writes as ' Sum logical write '
From (SELECT S.plan_handle,
SUM (S.execution_count) Sum_execution_count,
SUM (s.total_elapsed_time) Sum_total_elapsed_time,
SUM (s.total_worker_time) Sum_total_worker_time,
SUM (s.total_logical_reads) sum_total_logical_reads,
SUM (s.total_logical_writes) sum_total_logical_writes
From SYS. Dm_exec_query_stats S
GROUP by S.plan_handle
) as SS
Cross APPLY sys.dm_exec_sql_text (SS. plan_handle) T
ORDER by Sum_total_logical_reads DESC

SQL Server memory consumption high processing mode

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.