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 1uoJPz-001zVc-2R for pgsql-general@arkaria.postgresql.org; Tue, 19 Aug 2025 10:18:16 +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 1uoJPy-009Oro-4r for pgsql-general@arkaria.postgresql.org; Tue, 19 Aug 2025 10:18:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uoJPx-009Ooq-Pf for pgsql-general@lists.postgresql.org; Tue, 19 Aug 2025 10:18:14 +0000 Received: from mail-yb1-xb29.google.com ([2607:f8b0:4864:20::b29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uoJPw-000dMh-0A for pgsql-general@postgresql.org; Tue, 19 Aug 2025 10:18:13 +0000 Received: by mail-yb1-xb29.google.com with SMTP id 3f1490d57ef6-e93498d435cso2097416276.1 for ; Tue, 19 Aug 2025 03:18:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755598691; x=1756203491; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=bb8UDMvp9sz1YRMX26MeCgGexvOpjXEOiqtWdUE9G7E=; b=boM92owDAG8IfFN6tgkspCYal7iRa4DOH5f0umxElIVeI7RTHWu2kOzQn2qfFVjtq3 ffkGOBGMHV9m3eOxdCbYz8ZtTn3pSxGGO94+ThdEghhCxyTBzaaSInNJt0opJC2NxNqE IfcwPeg4HJ8IHjorqh//I+cz/l5EM2in8rlXox4HboOPHlAdKpNfwDADrHo89u/1S05H KJ+eRH33FABF6A5KE63fu880/fCSJKG6pTv7fTkWT/Oxds0XR7UypDCp24Qlm5Se+g/K /bgWiCnSwqw2wq9adq49AtMgDZz3P+hnrDDoN+ESTYB3DJ64iV89NAJ1tEEAWfKxzC8G SJ/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755598691; x=1756203491; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bb8UDMvp9sz1YRMX26MeCgGexvOpjXEOiqtWdUE9G7E=; b=Likm18ENaLmTGSn7zjoDBXreJWE3mx1QGyN7s24FjtBq/x6mfn0QZi/XlDPJobAK54 ZCb0URDIp3N5VJA4y9lRj7I6XssA3gar6eRFLx1IOVRIwtMuTi5fiHDHbbrZoqE/g9wl CLl7SzSZI1vOOZBO01OnRUvzlgknhUJvanVnv3H/NyHIzcaTP31g9YuYL7R8g84ATC1L /+8fSmNysvnC1bepcgCLxPkkQ58rEbbuYT+hBvIn4tDRzDyDn1LlWeUh7uZicbZNIuQi xSoJflKwoaBeT64sFvlOhtfr5OgeJ4U9SSrP9oZMicsoIKqdG1mmtfiC3/YdyYrHmvW4 El+g== X-Gm-Message-State: AOJu0YxM5H9wU5GbECR2eFdSZuqxJszR3PT3ENSJL5TGp7c80FTmFsVJ edpmJzQObKVspgbFeIj2yKjxRdfgmMR10DlwCl0VtPAkrYz8VL3p1V6V6Mavt3+RV/TeeXTup// rmPMgB54/+k8N2NXRTRzqO8cpjkmCtMf9xg== X-Gm-Gg: ASbGncuDGKS56pZI81jwKeY135Lrez7jMT9IXTq1y130SrLexor7HVSDmQj7pVaBRnm +g4M1duRShXYgX7mUYA092YH+7WzwRHru084DdOcuh84wWKoGscOTFnBjbLoW8dTXhOW6S3uVo+ /VxJl0Fnxf6bBE5G9aPwk48yykeW2WrkoQR8Ip3A5VF0zlnneyGH5s0t2r5PTKvE4l1a5woFYxc ZTC X-Google-Smtp-Source: AGHT+IGN5aZ+XV3wfyBRQonZSYUTBSB3H0K/7IgRdkKibpo7/LMsNzpsEkAO214rOxL4HMPf8BGQJBj4Wp52qAivGy8= X-Received: by 2002:a05:6902:200c:b0:e93:26ab:7db9 with SMTP id 3f1490d57ef6-e94e63b0fbemr2367504276.46.1755598691108; Tue, 19 Aug 2025 03:18:11 -0700 (PDT) MIME-Version: 1.0 From: David Mullineux Date: Tue, 19 Aug 2025 11:17:58 +0100 X-Gm-Features: Ac12FXzpVXLvKI4b3ZKP_ySw2ORsB7hu3eUaNnwl-po-6hlR_qJkRb9sNQjBHKc Message-ID: Subject: Why analyze reports 30000 pages and rows scanned. Why not just rows? To: Postgres General Content-Type: multipart/alternative; boundary="0000000000005a0c69063cb52caf" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005a0c69063cb52caf Content-Type: text/plain; charset="UTF-8" According to docs, analyze ,by default, will try to sample 30000 rows from a table. (I've read analyze.c note about Haas and Stokes IBM Research ). But my question is, why does 'analyze verbose' report that it has scanned '30000 of NNNN pages, containing NNNN live rows and 0 dead rows; 30000 rows in sample,....' As most tables would store more than 1 row per page, I expected that 30000 rows would require a lot fewer than 30000 *pages* to be scanned. Why is it saying it's scanned 30000 pages instead of only 30000 rows ? Confused. thanks. --0000000000005a0c69063cb52caf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
According to docs, analyze ,by default, will try to sampl= e 30000 rows from a table.
(I've read analyze.c note a= bout Haas and Stokes IBM Research ).

But my question is, why does 'analyze verbose' report = that it has scanned '30000 of NNNN pages, containing NNNN live rows and= 0 dead rows; 30000 rows in sample,....'

As most tables would store more than 1 row per page, I= expected that 30000 rows would require a lot fewer than 30000 pages= to be scanned.=C2=A0 Why is it saying it's scanned 30000 pages instead= of only 30000 rows ?

Confused. thanks.
--0000000000005a0c69063cb52caf--