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 1jinDL-0007sE-7d for pgsql-admin@arkaria.postgresql.org; Tue, 09 Jun 2020 22:59:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jinDK-000559-1p for pgsql-admin@arkaria.postgresql.org; Tue, 09 Jun 2020 22:59:26 +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 1jinDJ-000552-Pr for pgsql-admin@lists.postgresql.org; Tue, 09 Jun 2020 22:59:25 +0000 Received: from wforward5-smtp.messagingengine.com ([64.147.123.35]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jinDG-0002Sp-Ub for pgsql-admin@postgresql.org; Tue, 09 Jun 2020 22:59:24 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.west.internal (Postfix) with ESMTP id 6AACD49D; Tue, 9 Jun 2020 18:59:21 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 09 Jun 2020 18:59:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=VMT55PvNovXMnPnvNcPX4SimLvhjL1qdpTT/tjI8Y Zo=; b=afRHGlKuNBdJO0ufq77Xi039/25LkFYA94/BF/0Qi9O8lWTKHkUI0yeEr ov2zYH4AoHjJAokM0RYvFX4pmuKITFW3CWEJy2YeO37JblUrIsR+IsXg23Etnh5t ovMEVTHyc6fmiyyAQq6BOdhGyVbwNYNy9t3uqCNqkpejN6owzyaKEQLPpz6kPgfO izElNOWB3DNU+lBIpy0zHvuyOFLlpLYxtf26RNGl5tGQwDDLN+hVvlghbiyZiogA ZvEjMCOFaXFGDMZvsqbZID9pkd0cgIW6VVzKGRkUNApfTi83hNOVr299u5URrn/Z cR/c41IjNL7l2g/b1n6Vl36uoPlmQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudehhedgudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhohfkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvdhnug hquhgrughrrghnthdrtghomheqnecuggftrfgrthhtvghrnhepheeggfdvveekffehtefg teehtedugfelgefgtdffudfhleehfefgudfhffejteehnecuffhomhgrihhnpehpohhsth hgrhgvshhqlhdrohhrghdpvdhnughquhgrughrrghnthdrtghomhenucfkphepleefrddv geefrdekvddrvdegieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthesvdhnughquhgrughrrghnthdr tghomh X-ME-Proxy: Received: from april.pezone.net (p5df352f6.dip0.t-ipconnect.de [93.243.82.246]) by mail.messagingengine.com (Postfix) with ESMTPA id 2677D3061856; Tue, 9 Jun 2020 18:59:20 -0400 (EDT) Subject: Re: Understanding JSONB and TOAST tables To: Wells Oliver , pgsql-admin References: From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Wed, 10 Jun 2020 00:59:19 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-06-09 21:48, Wells Oliver wrote: > Is there documentation that lays out how JSONB columns are stored? I > have a Rather Large Table with 37m+ rows with large JSONB objects, its > size is about 300mb, but there's an associated TOAST table with a 28GB size. > > Curious how/why PSQL would store JSONB stuff this way. TOAST is documented here: https://www.postgresql.org/docs/current/storage-toast.html. JSONB is handled like any other (variable-size) data type. You can use the per-column storage settings mentioned on that page to perhaps achieve different storage outcomes. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services