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 1lb86z-0006sa-NZ for pgsql-general@arkaria.postgresql.org; Mon, 26 Apr 2021 20:45:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lb86x-00059R-Ty for pgsql-general@arkaria.postgresql.org; Mon, 26 Apr 2021 20:45:43 +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 1lb86x-00059K-MA for pgsql-general@lists.postgresql.org; Mon, 26 Apr 2021 20:45:43 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lb86u-0004RX-4q for pgsql-general@lists.postgresql.org; Mon, 26 Apr 2021 20:45:42 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 5EF175C01D9; Mon, 26 Apr 2021 16:45:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 26 Apr 2021 16:45:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=OVowORlVB9fpuFpHQBzef1IV5Wy1R7itzSgrGAyAAWY=; b=Rk127dX6 qkOz/qz7e2zkq6TcwibHzXTFSi4ZCh3jtLThctnGBC023+ae5M+/LS80O7wNXueg W3ZPDeDcOeesQZ5damLKO0p8dTC7An8zeEgc0pU4VtSZg1QhsSwcJ1qKPS/Aacwt m4c/8sbhTEHEQgC44YweqmDIEz8if4WmWsnSH5xrynxB2OdY538+JNcFJo9XixHJ TkSd9hLFyZauWMRIR5boCIs+1QDgB5EvWvDTiA4r02ZWBq/2lBc4lCgc5Jcp9sp7 /VJio5hMuT1y4MkLzuyT4TxQ/XOQOsSmbgrhT/tLNR9uzRiia93d8wuCJtyPFoaA cj8Ouy2P9md7lw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdduledgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkgggtugfgjggfsehtke ertddtredunecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhr vgesrghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpeeufffhjeeiue euffegvddukeegledtveeivdeiueefieeivefgteehueefteehvdenucfkphepudeltddr leehrdduledrleehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id 7DB6F108005C; Mon, 26 Apr 2021 16:45:37 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id AC4F52A0ADE; Mon, 26 Apr 2021 16:45:34 -0400 (-04) Date: Mon, 26 Apr 2021 16:45:34 -0400 From: Alvaro Herrera To: luis.roberto@siscobra.com.br Cc: pgsql-general Subject: Re: DB size Message-ID: <20210426204534.GA16381@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <133123052.3128057.1619468694515.JavaMail.zimbra@siscobra.com.br> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Apr-26, luis.roberto@siscobra.com.br wrote: > SELECT sum(pg_total_relation_size(relid)), > pg_size_pretty(sum(pg_total_relation_size(relid))) > FROM pg_catalog.pg_stat_all_tables > > > sum |pg_size_pretty| > ------------+--------------+ > 518549716992|483 GB | > > > SELECT pg_database_size('mydb'), > pg_size_pretty(pg_database_size('mydb')) > > > pg_database_size|pg_size_pretty| > ----------------+--------------+ > 869150909087|809 GB | > > There are three databases in the cluster, apart from 'mydb' (one of > them is the 'postgres' database). These other two size about 8MB each. I would guess that there are leftover files because of those crashes you mentioned. You can probably look for files in the database subdir in the data directory that do not appear in the pg_class.relfilenode listing for the database. -- Álvaro Herrera 39°49'30"S 73°17'W really, I see PHP as like a strange amalgamation of C, Perl, Shell inflex: you know that "amalgam" means "mixture with mercury", more or less, right? i.e., "deadly poison"