Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s6YLa-000HrA-NY for pgsql-admin@arkaria.postgresql.org; Mon, 13 May 2024 16:16:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s6YLZ-001znj-Aw for pgsql-admin@arkaria.postgresql.org; Mon, 13 May 2024 16:16:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s6YLY-001znO-TS for pgsql-admin@lists.postgresql.org; Mon, 13 May 2024 16:16:16 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s6YLV-0002Ee-N8 for pgsql-admin@lists.postgresql.org; Mon, 13 May 2024 16:16:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version :References:Reply-To:Message-ID:Subject:Cc:To:Sender:From:Date:Content-ID: Content-Description; bh=6aGJptK0FUTPF//DAtH+uZt6ZjalkUfzdSah76S7phE=; b=Kc/Y0 GJxQh9aAoMcjgm0lO0bab0mCIi2M0HDtTrpx9FlE/uO4CT8mz4L+M21up0NHKaDOuhHi2nTVis38p xwAiq7zjNZYs4LSOEuKd5Zyn+zRF83T+tfVnBRrALlZLYAVr5LbxWycwtLwsqXY4Jw9tv+GlMttS4 k8qDD5ZSae50=; Received: from depesz by depesz.com with local (Exim 4.96) (envelope-from ) id 1s6YLV-00GxcQ-0O; Mon, 13 May 2024 18:16:13 +0200 Date: Mon, 13 May 2024 18:16:13 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Siraj G Cc: Pgsql-admin Subject: Re: Not clear with the Explain Plan output Message-ID: Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, May 13, 2024 at 09:07:14PM +0530, Siraj G wrote: > Hello experts! > > I am new in the PgSQL domain, so I need assistance in understanding the > explain plan. I took the plan of a SQL via PgAdmin and it looks like the > attached one. I am unable to see the numbers that indicate where the heavy > processing is being done, to determine the IO and cpu processing. > > Is this the right way to collect explain plan? If so, how do I interpret > this? If there is another or a better way to collect this, please let me > know. Just run 'explain analyze' and read the text output. Graphs, in my opinion, hide too much info. Normal explain looks like: #v+ QUERY PLAN ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Sort (cost=35.41..35.50 rows=35 width=224) (actual time=0.160..0.162 rows=4 loops=1) Sort Key: n.nspname, c.relname Sort Method: quicksort Memory: 25kB Buffers: shared hit=15 -> Hash Join (cost=1.09..34.51 rows=35 width=224) (actual time=0.046..0.153 rows=4 loops=1) Hash Cond: (c.relnamespace = n.oid) Buffers: shared hit=15 -> Seq Scan on pg_class c (cost=0.00..32.16 rows=70 width=77) (actual time=0.009..0.107 rows=146 loops=1) Filter: ((relkind = ANY ('{r,p,v,m,S,f,""}'::"char"[])) AND pg_table_is_visible(oid)) Rows Removed by Filter: 280 Buffers: shared hit=14 -> Hash (cost=1.07..1.07 rows=2 width=68) (actual time=0.029..0.029 rows=2 loops=1) Buckets: 1024 Batches: 1 Memory Usage: 9kB Buffers: shared hit=1 -> Seq Scan on pg_namespace n (cost=0.00..1.07 rows=2 width=68) (actual time=0.013..0.015 rows=2 loops=1) Filter: ((nspname <> 'pg_catalog'::name) AND (nspname !~ '^pg_toast'::text) AND (nspname <> 'information_schema'::name)) Rows Removed by Filter: 3 Buffers: shared hit=1 Planning: Buffers: shared hit=9 Planning Time: 0.204 ms Execution Time: 0.189 ms (22 rows) #v- Best regards, depesz