sql语句 大量占用内存的查询解决办法
Jun 07, 2016 pm 05:48 PMsql语句涉及到大量占用内存的查询(如排序和哈希操作),内存不够,需要排队等待资源造成的,这是很多开发者碰到的问题,今天提供一些处理方法,希望对你有用。
解决办法:
A、优化语句,创建/使用合适的索引;
B、解决第一个问题的方法,更新要查询表的索引分发统计,保证估计时间的正确性,UPDATE STATISTICS 表名;
C、增加内存。
如果想手动设置查询超时,可以使用以下语句:
代码如下 | 复制代码 |
sp_configure 'show advanced options', 1 GO RECONFIGURE GO sp_configure 'query wait', 2147483647 GO RECONFIGURE GO |

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Reduce the use of MySQL memory in Docker

How do you alter a table in MySQL using the ALTER TABLE statement?

How to solve the problem of mysql cannot open shared library

What is SQLite? Comprehensive overview

Run MySQl in Linux (with/without podman container with phpmyadmin)

Running multiple MySQL versions on MacOS: A step-by-step guide

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?

How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)?
