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 1oAmgZ-0003jF-Rf for pgsql-admin@arkaria.postgresql.org; Mon, 11 Jul 2022 06:14:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oAmfa-0008Fk-A7 for pgsql-admin@arkaria.postgresql.org; Mon, 11 Jul 2022 06:13:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oAmfZ-0008Fb-TI for pgsql-admin@lists.postgresql.org; Mon, 11 Jul 2022 06:13:21 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oAmfW-0002Gj-HM for pgsql-admin@postgresql.org; Mon, 11 Jul 2022 06:13:21 +0000 Received: by mail-wr1-x431.google.com with SMTP id v16so5580979wrd.13 for ; Sun, 10 Jul 2022 23:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=cF6cY85WrzeNMzZz9s6mYd7eOgEFQubTnu7FZcSXIJI=; b=n3QvFtfcjGSrbBC9mqKG8XSd5V4uIDkjkMIv5FleVt353pFwiPb4kYon5wrANo2nk5 pD22MYN/4z+dxiPccYKoai4FaZ0u3QsDiddThmDNDPDxFtLTVfvrrHIBObgte4EeL1ng I2kQl6hzhBKW8rE/qPn9OAaIAggRTJbp+kwITOe7rAtjH1T4LHz9BSlpwGw+Ir2r4vEM 0aHdiKIhHTg/vn4jrE289A/lWxIQ35TiTeITIarbNnurkqsQ2z+3mgHlHUhUr4Hh/Pdt Be7UWxiWmMouUR14EuxqDCTQHTCc5IXcGM1bIYxQkMBGF8TAoDFrVQ4Lv52NT7Cu8Jkc oPrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=cF6cY85WrzeNMzZz9s6mYd7eOgEFQubTnu7FZcSXIJI=; b=PdhbkgmhjzQkSG/LWLFAhNs7r4m+7iDKsRk/VtTEPmPmuRjMZYzXf273nOgp0vtPaa u+kWuKbHErBY4eDUF0AA7jNFtYDmy2XTUHVlnUJgErF9Sj9z6LhDUEacIIZ+zr7CusGb xte34RI2/ktH7OlZqkoHLh+ZUeSCeNN2lfT7fmGCFWIhfou+Eh92he9c351mNo3zM3wz Ch3w0hEEucYjZ/6H8VR0/KgCRfHdIllaVBEd1I4Q7NnC/pps13okvSZeEoXmyxQ8b+Bt zuE/wy7Lp0PNDOBpgyqKfMawfr41/a91oAsPAm1318knOawoKka5zL1dibt1/cSxkKzc tWhQ== X-Gm-Message-State: AJIora+Dh++VYyVua43u4U3XrR3CvUYwUQyMxgKWw+JX0jrZj+gUujoN HuPuDPN436olTlqQX2Njv7rfuNx2G+3oyQ== X-Google-Smtp-Source: AGRyM1tcvXIYYHyI5HtuIjN0eSCKACPVDyjFkRl8Xg1OnU4tHjhthIpxFgXMveL1MAmDGWpiYZtNng== X-Received: by 2002:adf:d090:0:b0:21d:aa9b:9998 with SMTP id y16-20020adfd090000000b0021daa9b9998mr1310717wrh.33.1657519997423; Sun, 10 Jul 2022 23:13:17 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:29e:59ef:60fe:cdc7:6be]) by smtp.gmail.com with ESMTPSA id w13-20020adff9cd000000b0021d20461bbbsm4930156wrr.88.2022.07.10.23.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jul 2022 23:13:16 -0700 (PDT) Message-ID: <2b5df78128c02a4389f4fb9a05c0fd8084583c6a.camel@cybertec.at> Subject: Re: Storing large large JSON objects in JSONB From: Laurenz Albe To: Wells Oliver , pgsql-admin Date: Mon, 11 Jul 2022 08:13:16 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 2022-07-09 at 12:37 -0700, Wells Oliver wrote: > We have a couple of tables where we like to store very large JSON objects > in a JSONB column. We don't use these in, err, real time kind of situations, > intensive queries, etc, so I'm not concerned about their performance > necessarily, it's more just to store vendor data that's parsed as we go into > smaller more usable tables, and so they serve as the historical record, > and occasionally we re-process. > > I'm wondering if there's some smarter solution with Postgres, these usually > end up in TOAST tables as I understand it, so the actual table is quite small > and then there's some associated TOAST thing that grows and grows (the given > one right now is 500GB). > > I don't.. really... care, I guess, that the TOAST tables are that large, > but I thought I might do the diligence here and ask if there's some different > solution, or if this is fine, or some kind of ticking time bomb I am > understanding poorly. > > We like these in the database as we have SQL scripts to parse them, so saving > them as files in S3 and rewriting ETL in python or whatever kind sounds awful. I know of no problem this could cause, other than that if your database grows very large, it may be a pain to backup. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com