简体   繁体   中英

Query execution taking too much time

I am trying to executing a very large select query into a 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

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

  • shared_buffers should be 10% to 25% of available RAM
  • effective_cache_size should be 75% of available RAM

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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