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 1maMIk-0002Wb-7E for pgsql-general@arkaria.postgresql.org; Tue, 12 Oct 2021 18:14:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1maMIj-0006oS-56 for pgsql-general@arkaria.postgresql.org; Tue, 12 Oct 2021 18:14:57 +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 1maMIi-0006oK-SN for pgsql-general@lists.postgresql.org; Tue, 12 Oct 2021 18:14:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1maMIg-0007wM-UX for pgsql-general@lists.postgresql.org; Tue, 12 Oct 2021 18:14:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 19CIEkEK585460; Tue, 12 Oct 2021 14:14:46 -0400 From: Tom Lane To: Michael Lewis cc: Simon Riggs , Ram Pratap Maurya , "pgsql-general@lists.postgresql.org" , Manu Saxena Subject: Re: Avg/max size of these JSON docs in Postgres In-reply-to: References: Comments: In-reply-to Michael Lewis message dated "Tue, 12 Oct 2021 11:53:09 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <585458.1634062486.1@sss.pgh.pa.us> Date: Tue, 12 Oct 2021 14:14:46 -0400 Message-ID: <585459.1634062486@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Lewis writes: > Just to confirm- The compression associated with TOAST is only if the value > can fit in line, right? Columns don't get stored out-of-line in a toast > table as a compressed value as I read the documentation. I suppose that > would make reads a bit crazy. The default behavior is first to compress any large field value(s), and then if the row is still too big, push them out-of-line in compressed form. You can modify that strategy on a per-column basis if need be, but I've seldom heard good reasons to. regards, tom lane