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 1jKcxs-0002K0-5Z for pgsql-general@arkaria.postgresql.org; Sat, 04 Apr 2020 07:11:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jKcxr-0003li-4m for pgsql-general@arkaria.postgresql.org; Sat, 04 Apr 2020 07:11:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKcxq-0003lb-TV for pgsql-general@lists.postgresql.org; Sat, 04 Apr 2020 07:11:34 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKcxn-00033g-N9 for pgsql-general@postgresql.org; Sat, 04 Apr 2020 07:11:33 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id C9D2F1C16 for ; Sat, 4 Apr 2020 10:11:27 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id paBNlOldXJ2Y for ; Sat, 4 Apr 2020 10:11:25 +0300 (EEST) Received: from mail.hot.ee (hot-relayhost2.estpak.ee [213.180.2.80]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id A58981C3B for ; Sat, 4 Apr 2020 10:11:25 +0300 (EEST) Received: from dell2 (82.131.99.74.cable.starman.ee [82.131.99.74]) (Authenticated sender: kobruleht2) by HOT-Relayhost2.estpak.ee (Postfix) with ESMTPSA id 48vSdn4FHhz2j9 for ; Sat, 4 Apr 2020 10:11:24 +0300 (EEST) Message-ID: <3D72D8D12557453AB3E0EB46FB911C17@dell2> From: "Andrus" To: "pgsql-general" Subject: Why there is 30000 rows is sample Date: Sat, 4 Apr 2020 10:07:51 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="windows-1257"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi! vacuumdb output: vacuumdb: vacuuming database "mydb" INFO: analyzing "public.mytable" INFO: "mytable": scanned 2709 of 2709 pages, containing 10834 live rows and 0 dead rows; 10834 rows in sample, 10834 estimated total rows For tables with more than 30000 rows, it shows that there are 30000 rows in sample. postgresql.conf does not set default_statistics_target value. It contains #default_statistics_target = 100 # range 1-10000 So I expect that there should be 100 rows is sample. Why Postgres uses 30000 or number of rows in table for smaller tables ? Is 30000 some magical value, how to control it. Using Postgres 12 in Debian. Andrus.