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 1qyfCw-00A3uZ-Fv for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Nov 2023 21:26:30 +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 1qyfBw-00FfE4-HP for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Nov 2023 21:25:28 +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 1qyfBw-00FfDw-6r for pgsql-hackers@lists.postgresql.org; Thu, 02 Nov 2023 21:25:28 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qyfBo-004NwE-JW for pgsql-hackers@postgresql.org; Thu, 02 Nov 2023 21:25:27 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40842752c6eso10764335e9.1 for ; Thu, 02 Nov 2023 14:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1698960319; x=1699565119; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=xIFtT34wATnD+Kr6eSItuRSgMAxP4OBvXDbK8QtfDc0=; b=hR01i7FvYi1d6qOsKmbkXTl/OjKnLZpkd1kGTRQ5z5PzjNj/O/1qNxhSy1IC7xYiT2 0/2iGw8TS9yVlp0a2k3Zj0meH1RlS+Aho0cvpByPgYX+2VJoHYJRq7xY6DdUJgLvlRQE knYyJ+VQQxaHNxshCRY7/rCFl0sHvI4Fcv6THDza8wAbJ3494Q7KNGrbPeWzPZbUeeJV BOQw0JXh8xPUe4lRGsNfumq5sjojO/9NgpD2mztv8NBe7yQfhNy250TMJ4sy7qSTPCwM cyi5Y7/sqqHKZkOoysyDgMz/1+r4+bZ2HlxRX5GhcYOUB4BBOLGWTBSL1GzdsmWR5rx+ PVwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698960319; x=1699565119; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xIFtT34wATnD+Kr6eSItuRSgMAxP4OBvXDbK8QtfDc0=; b=HDeJycOmqDcKfkLjo5nMviDgoD+zmSUeALk/n5ODUYVZfXAXsFzaDADv6e9LV8bXdZ /DQ0JbXoPAu74SfNBgiGoyXHvQiVWr6srCY8x9x3PDPorVvcwmAJ7tq6LqX9MxfCFfjr u4IqkAegVH/KcgKNCYn404eLm5IBmrxXzTBnai4ctFUTmVc/TNn+rVLqKv8v2y9Q8iKe eY818XXCqUpYvlwRXWhKcQCGb5CrTZv94sqnyqTgE+bu3iUtB5Ooz+aO9348JAg1cIiw bKZIl4hN+tbQkY4HJKR4frZVqKlXZTj+wqmWaomrRS5/UfIi+nIeqgYCGW9vt50sC3hx Ys5A== X-Gm-Message-State: AOJu0Yzb7Med/tOyR8fLox3r2ZQ0hm+Jd+iSR0jXK/HzCIwugCnQriIu 3lT2jBOsMw8/rY6VDTfkFdhyjA== X-Google-Smtp-Source: AGHT+IGlp6DLPWkFSGHmg30YmRfKrWKwlT2Fof1SMXVJCBCNVUC7A53jM3Hlt+TIMeRo0D+CN8liNw== X-Received: by 2002:a5d:674c:0:b0:32d:bc7d:c431 with SMTP id l12-20020a5d674c000000b0032dbc7dc431mr15718610wrw.1.1698960318839; Thu, 02 Nov 2023 14:25:18 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-228-220.bb.vodafone.cz. [86.49.228.220]) by smtp.gmail.com with ESMTPSA id z16-20020a5d6550000000b0032dbf6bf7a2sm282001wrv.97.2023.11.02.14.25.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Nov 2023 14:25:18 -0700 (PDT) Message-ID: <886b209f-8736-9cf2-ab9c-89870dea7bd8@enterprisedb.com> Date: Thu, 2 Nov 2023 22:25:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: Detoasting optionally to make Explain-Analyze less misleading Content-Language: en-US To: Matthias van de Meent Cc: stepan rutz , Tom Lane , pgsql-hackers@postgresql.org References: <2802772.1694532399@sss.pgh.pa.us> <03f952d6-b773-be93-e5d5-8f9ea9c2d461@gmx.de> <7b7d46b1-d6f7-eb10-55c9-aa45fce57781@enterprisedb.com> <9126b7da-204b-4701-8e2b-37fb824a0cf4@gmx.de> <78507aa1-f850-50cd-458a-3986d973d092@enterprisedb.com> From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/2/23 21:02, Matthias van de Meent wrote: > On Thu, 2 Nov 2023 at 20:32, Tomas Vondra wrote: >> On 11/2/23 20:09, stepan rutz wrote: >>> db1=# explain (analyze, serialize) select * from test; >>> QUERY PLAN >>> --------------------------------------------------------------------------------------------------- >>> Seq Scan on test (cost=0.00..22.00 rows=1200 width=40) (actual >>> time=0.023..0.027 rows=1 loops=1) >>> Planning Time: 0.077 ms >>> Execution Time: 303.281 ms >>> Serialized Bytes: 78888953 Bytes. Mode Text. Bandwidth 248.068 MB/sec >> [...] >> BTW if you really want to print amount of memory, maybe print it in >> kilobytes, like every other place in explain.c? > > Isn't node width in bytes, or is it an opaque value not to be > interpreted by users? I've never really investigated that part of > Postgres' explain output... > Right, "width=" is always in bytes. But fields like amount of sorted data is in kB, and this seems closer to that. >> Also, explain generally >> prints stuff in "key: value" style (in text format). > > That'd be key: metrickey=metricvalue for expanded values like those in > plan nodes and the buffer usage, no? > Possibly. But the proposed output does neither. Also, it starts with "Serialized Bytes" but then prints info about bandwidth. >>> Serialized Bytes: 78888953 Bytes. Mode Text. Bandwidth 248.068 MB/sec > > I was thinking more along the lines of something like this: > > [...] > Execution Time: xxx ms > Serialization: time=yyy.yyy (in ms) size=yyy (in KiB, or B) mode=text > (or binary) > > This is significantly different from your output, as it doesn't hide > the measured time behind a lossy calculation of bandwidth, but gives > the measured data to the user; allowing them to derive their own > precise bandwidth if they're so inclined. > Might work. I'm still not convinced we need to include the mode, or that the size is that interesting/useful, though. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company