简体   繁体   English

查询执行花费太多时间

[英]Query execution taking too much time

I am trying to executing a very large select query into a temp_table我正在尝试对temp_table执行一个非常大的选择查询

CREATE TEMP TABLE tmp_tblp 
AS (my select query which is very long, consists of many inner joins)
  • This query is running for a long time (more than 6 mins because I just selected only a few amounts of criteria in the where clause and date period is taken for 10 Days in actual case this will be for one month) and returns 4443 rows这个查询运行了很长时间(超过 6 分钟,因为我只是在 where 子句中只选择了几个条件,并且日期周期为 10 天,在实际情况下这将是一个月)并返回4443 rows

and here is my query是我的查询

try this尝试这个

SET temp_buffers = '1GB'; 
SET work_mem = '1GB';
set shared_buffers='1GB';
set effective_cache_size='1GB';

before executing your query , the above values is for 3GB RAM在执行query之前,上述值适用于3GB RAM

  • shared_buffers should be 10% to 25% of available RAM shared_buffers 应该是可用 RAM 的 10% 到 25%
  • effective_cache_size should be 75% of available RAM Effective_cache_size 应该是可用 RAM 的 75%

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM