Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZUyN-0005vf-Ow for pgsql-performance@arkaria.postgresql.org; Wed, 19 Dec 2018 06:04:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZUyL-0002vp-0M for pgsql-performance@arkaria.postgresql.org; Wed, 19 Dec 2018 06:04:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZUyK-0002vi-M3 for pgsql-performance@lists.postgresql.org; Wed, 19 Dec 2018 06:04:44 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZUyH-0001cE-Hb for pgsql-performance@postgresql.org; Wed, 19 Dec 2018 06:04:43 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 48C7810E5567C for ; Tue, 18 Dec 2018 23:04:40 -0700 (MST) Date: Tue, 18 Dec 2018 23:04:40 -0700 (MST) From: anand086 To: pgsql-performance@postgresql.org Message-ID: <1545199480113-0.post@n3.nabble.com> Subject: SQL Perfomance during autovacuum MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi All, I am looking into a performance issue and needed your input and thoughts. We have table (non-partitioned) of 500Gb with 11 indexes +--------------+---------------+--------------+-------------+--------------+---------+--------+------------+--------+ | row_estimate | total_bytes | index_bytes | toast_bytes | table_bytes | total | index | toast | table | +--------------+---------------+--------------+-------------+--------------+---------+--------+------------+--------+ | 1.28611e+09 | 1400081645568 | 858281418752 | 8192 | 541800218624 | 1304 GB | 799 GB | 8192 bytes | 505 GB | +--------------+---------------+--------------+-------------+--------------+---------+--------+------------+--------+ Application runs a simple sql , select distinct testtbl_.id as col_0_0_ from demo.test_table testtbl_ where testtbl_.entity_id='10001' and testtbl_.last_updated>=to_date('22-10-2018', 'dd-MM-yyyy') and testtbl_.last_updated0 and testtbl_.src_name='distribute_item' and (testtbl_.item not like 'SHIP%') order by testtbl_.id limit 10000; The Execution time for the above sql is 17841.467 ms during normal operations but when autovacuum runs on table test_table, the same sql took 1628495.850 ms (from the postgres log). We have noticed this increase in execution times for the sqls only when autovacuum runs and it runs with prevent wraparound mode. I think during the autovacuum process the Buffers: shared hit are increasing causing increase in execution time. I need help with the approach to debug this issue. Is this expected behaviour wherein sql execution timing incease during the autovacuum? If so , what is the reason for the same? -- Sent from: http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html