Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gCVcb-0000k8-D1 for pgsql-general@arkaria.postgresql.org; Tue, 16 Oct 2018 20:07:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gCVcZ-0006Dw-BP for pgsql-general@arkaria.postgresql.org; Tue, 16 Oct 2018 20:07:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gCVcZ-0006Dp-0j for pgsql-general@lists.postgresql.org; Tue, 16 Oct 2018 20:07:15 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gCVcS-0001so-QD for pgsql-general@postgresql.org; Tue, 16 Oct 2018 20:07:14 +0000 Received: by mail-pf1-x42a.google.com with SMTP id p24-v6so11977567pff.10 for ; Tue, 16 Oct 2018 13:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=popztWj4NCS1SqvIVboO8//4YIADGpXr1VULKuMVsFQ=; b=Zl1e/7hEI/++7klx4dbgwHJkZLuA16/ukk1WNbOZSJU+DapgKBKWcd90AmlhCZysDb Mkqcs0+BXBQQoC/Q5MD3tzkbM0Pq/6b5wPH0n3i/GzTtdA13+js1L5eaMxmWeWUiVGxC fscZBkZh/w75qdNdrYPpWYGreAFZ+ZtIv+w45b+lwwUEDb1jQGv0xGpT7+NhB6lDHxlQ Cp6Jon1gZgwPhJG2ogGKB72U5B826OUWW2I2kHwW3CM8JME38nYv5ybuyHYGODeoYEPj F4cu9ipKiNayCbgsOzmrk/NZWgmHhqEi7pxE6neYDMbM8hqFHQSx+FspqznoK18EV5K2 ol/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=popztWj4NCS1SqvIVboO8//4YIADGpXr1VULKuMVsFQ=; b=HqhANnUPTRQDs5e6qZFe4oczZVu1cZSzWLptGuIaSUiyo9lGinM8lMhia5T53TRov3 gertAs01JNv/Q0DpNz67dF3NAX1560hqGuz0yjE/WYoOizAnGEu+KHZroqG2Ouqe6l1V W4/e1h6avPPT3Gxin6FS0q9I0ja6E9JUv3YnWMj38OhMZx8qK2CrliFBk+WspZzkPMCc 1jX196CvmtkZOPl+29twlb+EFbUOmI6hfBv3cW2jF1MAZBCg6sFJ+mkuPu4nE/pz0Jhi 0D6I5xwvbZ3ys7NANOqc4cWACd6T4Gi/c4S1NPcgGyq4Zu2vtyYHcudoxqNIfCNtF0i4 Yz5w== X-Gm-Message-State: ABuFfoif8tk7r5sww0XykXamE9QzkPtIC9nnrw03RTeBJhaVoyE1gd3I HoGNqi6Fsm7qYbPZaYoVQYY= X-Google-Smtp-Source: ACcGV62gRUpabifLpqHEoOEffE9JTHRfUET1Txb4JcdheC7ZRpX3hUNGhHQeDALoMoF8XPKFSMtpMg== X-Received: by 2002:a62:fcd8:: with SMTP id e207-v6mr23083812pfh.132.1539720425979; Tue, 16 Oct 2018 13:07:05 -0700 (PDT) Received: from [10.104.82.184] ([155.100.47.0]) by smtp.gmail.com with ESMTPSA id d7-v6sm23266733pfm.23.2018.10.16.13.07.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Oct 2018 13:07:05 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: judging acceptable discrepancy in row count v. estimate From: Rob Sargent In-Reply-To: <24387.1539716472@sss.pgh.pa.us> Date: Tue, 16 Oct 2018 14:07:04 -0600 Cc: "pgsql-general@postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <65FFDBB8-23F3-46F4-81CD-2748B271EA58@gmail.com> References: <37AF5C49-8550-4738-912D-859F685DB3D4@gmail.com> <24387.1539716472@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3445.9.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Oct 16, 2018, at 1:01 PM, Tom Lane wrote: >=20 > Rob Sargent writes: >> Should reality be half again as large as the estimated row count? >> coon=3D# select count(*) from sui.segment; >> count =20 >> ---------- >> 49,942,837 -- my commas >> (1 row) >=20 >> coon=3D# vacuum (analyse, verbose) sui.probandset; >=20 > Uh, what does sui.probandset have to do with sui.segment ? >=20 > regards, tom lane In fullness,=20 INFO: analyzing "sui.segment" INFO: "segment": scanned 30000 of 1019242 pages, containing 1470000 = live rows and 0 dead rows; 30000 rows in sample, 49942858 estimated = total rows VACUUM Time: 321934.748 ms (05:21.935) So, rather accurately estimated (no inserts, deletes) since bogus = report. Looks like its good to 5+ decimal places, given sufficient = records. select 49942858.0/49942837.0; ?column? =20 ------------------------ 1.00000042048071878656 (1 row) This table has no variable length columns. I imagine that helps.