Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lGjiX-0007yZ-GC for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Mar 2021 14:40:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lGjiW-0000sH-9a for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Mar 2021 14:40:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lGjiW-0000sA-3g for pgsql-bugs@lists.postgresql.org; Mon, 01 Mar 2021 14:40:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lGjiU-0006DR-1U for pgsql-bugs@lists.postgresql.org; Mon, 01 Mar 2021 14:40:11 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 121Ee7oZ715950; Mon, 1 Mar 2021 09:40:07 -0500 From: Tom Lane To: tejaschavanr10@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16904: Dropping and recreating a large table with 5 indexes slowed down query performance In-reply-to: <16904-a93be8f06fa8c49b@postgresql.org> References: <16904-a93be8f06fa8c49b@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 01 Mar 2021 08:58:28 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <715948.1614609607.1@sss.pgh.pa.us> Date: Mon, 01 Mar 2021 09:40:07 -0500 Message-ID: <715949.1614609607@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > The steps performed are as below: > - Renamed the original table as _bkp > - Dropped indexes and constraints on the backup table > - Created the original table along with indexes with the same index name as > before > Post performing this activity, the queries which where performing well > before are running very slow. Perhaps ANALYZE'ing the new table would help. I'd have expected autovacuum to do that for you by now, but maybe it's not able to complete for some reason. regards, tom lane