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 1jyJhL-0006hL-6O for pgsql-admin@arkaria.postgresql.org; Wed, 22 Jul 2020 18:42:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jyJhH-0001tD-QJ for pgsql-admin@arkaria.postgresql.org; Wed, 22 Jul 2020 18:42:31 +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 1jyJhH-0001t6-Ib for pgsql-admin@lists.postgresql.org; Wed, 22 Jul 2020 18:42:31 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jyJhC-0002ZX-OD for pgsql-admin@postgresql.org; Wed, 22 Jul 2020 18:42:30 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1jyJhB-0004Az-Jw; Wed, 22 Jul 2020 14:42:25 -0400 Date: Wed, 22 Jul 2020 14:42:25 -0400 From: Bruce Momjian To: Wells Oliver Cc: pgsql-admin Subject: Re: More efficient access of JSON array elements? Message-ID: <20200722184225.GD3899@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, Jul 18, 2020 at 06:22:20PM -0700, Wells Oliver wrote: > Hi: I'm wondering if there's an application of GIN (or otherwise) indexing with > jsonb columns to help speed up some queries where I'm not using WHERE clauses, > but unpacking rather large json objects to rows via jsonb_array_elements: it > seems indexing largely helps when filtering, but this is more unpacking/ > flattening with really quite sizable objects. You can use JSON (not JSONB) to get faster loading/unloading, but much slower filtering. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee