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 1pFrkn-0002j5-KE for pgsql-general@arkaria.postgresql.org; Thu, 12 Jan 2023 07:12:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pFrkm-0002u8-IO for pgsql-general@arkaria.postgresql.org; Thu, 12 Jan 2023 07:12:00 +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 1pFrkm-0002ty-7j for pgsql-general@lists.postgresql.org; Thu, 12 Jan 2023 07:12:00 +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 1pFrkj-0000Hm-BU for pgsql-general@lists.postgresql.org; Thu, 12 Jan 2023 07:11:59 +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 30C7BtTd905815; Thu, 12 Jan 2023 02:11:55 -0500 From: Tom Lane To: Ron cc: pgsql-general Subject: Re: EXPLAIN and FK references? In-reply-to: <431108a8-d814-848e-202b-e3a8e78ea39a@gmail.com> References: <269a6794-aa20-283d-bbc4-8cddaa2038de@gmail.com> <899474.1673503646@sss.pgh.pa.us> <431108a8-d814-848e-202b-e3a8e78ea39a@gmail.com> Comments: In-reply-to Ron message dated "Thu, 12 Jan 2023 01:03:10 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <905813.1673507515.1@sss.pgh.pa.us> Date: Thu, 12 Jan 2023 02:11:55 -0500 Message-ID: <905814.1673507515@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ron writes: > On 1/12/23 00:07, Tom Lane wrote: >> No, not directly, but you could look at EXPLAIN ANALYZE to see which >> of the RI triggers is eating the time. > Good to know, but even deleting one day of data (90,000 rows using an index > scan on the date field) takes forever. So delete a relatively small number of rows, and do it with EXPLAIN *ANALYZE*. Without ANALYZE, you aren't getting any relevant data. regards, tom lane