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 1rv008-0091Hp-Dl for pgsql-admin@arkaria.postgresql.org; Thu, 11 Apr 2024 19:22:25 +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 1rv007-004Rym-GO for pgsql-admin@arkaria.postgresql.org; Thu, 11 Apr 2024 19:22:23 +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 1rv005-004Ryb-Tl for pgsql-admin@lists.postgresql.org; Thu, 11 Apr 2024 19:22:23 +0000 Received: from wfhigh4-smtp.messagingengine.com ([64.147.123.155]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rv002-002ONZ-Om for pgsql-admin@lists.postgresql.org; Thu, 11 Apr 2024 19:22:20 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id 18EF018000F8; Thu, 11 Apr 2024 15:22:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 11 Apr 2024 15:22:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= quadratum-braccas.com; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1712863336; x=1712949736; bh=tPD9o7D2eDjO20W0gVJI0mp5oyMrHWubm+XWCJ7teig=; b= a41041XqOPSx8XG8F2QloRIf8QMXbkSVTKtx3O0IFe3SDP9/NjLxY8GDzswvf76o bSFulBPOqt2B9ueBQpII+NVPEHgipZMjRMoXkzp3j92z38qo1k55N1IDsJ28SdOW qBMIRhtorPgDG2NTO0UTOptAJKjnOyD53TaL3qSA8gaZzGHEUNf4ZTCDZqD9mQ4U c5EdP8YvWuLfPNsQiuvsxsYYlj6Sknz+MkyWNRlfzdeeZfNHm61vHTmBC0feGn6q mncOwa1z5I7hPjiWU307dr7eikY/iLo2Vtq2JUQUJPUHzoUF1xz49PQMo4N0Bahm ETWaV1LeV+kCssrl6L9aIg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712863336; x=1712949736; bh=tPD9o7D2eDjO20W0gVJI0mp5oyMr HWubm+XWCJ7teig=; b=vU5YK2jS/ZQSGzQyixeIm6DPsdYQidcFIM9ZHcJJckbZ /fvJ3k3Qn8UXjtmHc/uVincMzIZ4YzbNmf+0OcJQWhyX0SSIW0DvFQU5TVujyQUl 7xhNkzwIAs4Tx/GE0GHYWg5l30tVjORiuU5GqEQCs41G1QHyWAcR6RPsrhFuFEvD 3u8vpJKkisVljq5qavpWIHMuQcPvlUj/EIlqjUvV6Zw4bLTJL9wOYewaJVhW4zmQ eiWvVk7QdULR8/DWemBViF2ZJoWqHKSNnXBlmLNxF92iD7jFo/JoLl6atz4b3ZP7 QZowQ81NoParf+geDPkU08XCbmY/OgB7O74mluqtYg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudehkedgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtkfffgggfuffvvehfhfgjsegrtderredtvdejnecuhfhrohhmpefusgho sgcuoehssghosgesqhhurggurhgrthhumhdqsghrrggttggrshdrtghomheqnecuggftrf grthhtvghrnhepieetleektefhgeeutdegvdeggfelfedtvefgvddugeejffduhfejjeeg gfeuledunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epshgsohgssehquhgrughrrghtuhhmqdgsrhgrtggtrghsrdgtohhm X-ME-Proxy: Feedback-ID: i374947ac:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Apr 2024 15:22:14 -0400 (EDT) Content-Type: multipart/alternative; boundary="------------rdk0tFVE0ilidWdrlqxLUqKs" Message-ID: Date: Thu, 11 Apr 2024 13:22:12 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pg_total_relation_size shows 0 byt table has thousands of rows To: "David G. Johnston" Cc: Pgsql-admin References: Content-Language: en-US From: Sbob In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------rdk0tFVE0ilidWdrlqxLUqKs Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit This is on PG version 14 sales_info=# select count(*) from sales_info.reject_errors;  count --------  688422 (1 row) sales_info=# select pg_total_relation_size ('sales_info.reject_errors');  pg_total_relation_size ------------------------                       0 (1 row) sales_info=# analyze sales_info.reject_errors; ANALYZE sales_info=# vacuum sales_info.reject_errors; VACUUM sales_info=# select pg_total_relation_size ('sales_info.reject_errors');  pg_total_relation_size ------------------------                       0 (1 row) sales_info=# select pg_total_relation_size ('sales_info.reject_errors'::regclass);  pg_total_relation_size ------------------------                       0 (1 row) sales_info=# select oid from pg_class where relname = 'reject_errors';   oid -------  39379 (1 row) sales_info=# select pg_total_relation_size (39379);  pg_total_relation_size ------------------------                       0 (1 row) On 4/11/24 12:30, David G. Johnston wrote: > On Thu, Apr 11, 2024 at 11:11 AM Sbob wrote: > > > I have a table that has 39,000 rows in it, but a > pg_total_relation_size('schema.table') shows a size of 0 > > I did a vacuum and an analyze but no change > > Thoughts? > > > Copy and paste the exact queries you are running and the results they > are giving. > > David J. > --------------rdk0tFVE0ilidWdrlqxLUqKs Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

This is on PG version 14


sales_info=# select count(*) from sales_info.reject_errors;
 count  
--------
 688422
(1 row)

sales_info=# select pg_total_relation_size ('sales_info.reject_errors');
 pg_total_relation_size
------------------------
                      0
(1 row)

sales_info=# analyze sales_info.reject_errors;
ANALYZE
sales_info=# vacuum sales_info.reject_errors;
VACUUM
sales_info=# select pg_total_relation_size ('sales_info.reject_errors');
 pg_total_relation_size
------------------------
                      0
(1 row)

sales_info=# select pg_total_relation_size ('sales_info.reject_errors'::regclass);
 pg_total_relation_size
------------------------
                      0
(1 row)

sales_info=# select oid from pg_class where relname = 'reject_errors';
  oid  
-------
 39379
(1 row)

sales_info=# select pg_total_relation_size (39379);
 pg_total_relation_size
------------------------
                      0
(1 row)




On 4/11/24 12:30, David G. Johnston wrote:
On Thu, Apr 11, 2024 at 11:11 AM Sbob <sbob@quadratum-braccas.com> wrote:

I have a table that has 39,000 rows in it, but a
pg_total_relation_size('schema.table') shows a size of 0

I did a vacuum and an analyze but no change

Thoughts?


Copy and paste the exact queries you are running and the results they are giving.

David J.

--------------rdk0tFVE0ilidWdrlqxLUqKs--