Home > Database > Mysql Tutorial > body text

sql语句 大量占用内存的查询解决办法

WBOY
Release: 2016-06-07 17:48:22
Original
2043 people have browsed it

sql语句涉及到大量占用内存的查询(如排序和哈希操作),内存不够,需要排队等待资源造成的,这是很多开发者碰到的问题,今天提供一些处理方法,希望对你有用。

解决办法:

    A、优化语句,创建/使用合适的索引;

    B、解决第一个问题的方法,更新要查询表的索引分发统计,保证估计时间的正确性,UPDATE  STATISTICS 表名;

    C、增加内存。

    如果想手动设置查询超时,可以使用以下语句:

 代码如下 复制代码
sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
sp_configure 'query wait', 2147483647
GO
RECONFIGURE
GO
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!