Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YI1kX-0001go-35 for pgsql-performance@arkaria.postgresql.org; Sun, 01 Feb 2015 21:08:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YI1kW-0007MC-HX for pgsql-performance@arkaria.postgresql.org; Sun, 01 Feb 2015 21:08:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YI1kV-0007Jb-28 for pgsql-performance@postgresql.org; Sun, 01 Feb 2015 21:08:07 +0000 Received: from mx-out.zmailcloud.com ([192.198.85.98] helo=mx-out-1.zmailcloud.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YI1kR-0006EH-W4 for pgsql-performance@postgresql.org; Sun, 01 Feb 2015 21:08:05 +0000 Received: from smtp.01.com (smtp.01.com [10.10.0.43]) by mx-out-1.zmailcloud.com (Postfix) with ESMTP id 95427564152; Sun, 1 Feb 2015 15:08:03 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 78B51A0377; Sun, 1 Feb 2015 15:08:03 -0600 (CST) X-Virus-Scanned: amavisd-new at smtp-out-1.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0xM17ZB-_Bm1; Sun, 1 Feb 2015 15:08:03 -0600 (CST) Received: from smtp.01.com (localhost [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 3F815A03D4; Sun, 1 Feb 2015 15:08:03 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 0D49AA03C8; Sun, 1 Feb 2015 15:08:03 -0600 (CST) X-Virus-Scanned: amavisd-new at smtp-out-1.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-1.01.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id FVkGUXVcRNR2; Sun, 1 Feb 2015 15:08:02 -0600 (CST) Received: from [192.168.47.107] (50-0-164-164.dsl.dynamic.fusionbroadband.com [50.0.164.164]) by smtp-out-1.01.com (Postfix) with ESMTPSA id 600A5A0377; Sun, 1 Feb 2015 15:08:02 -0600 (CST) Message-ID: <54CE95B1.8020401@agliodbs.com> Date: Sun, 01 Feb 2015 13:08:01 -0800 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Jim Nasby , Peter Geoghegan CC: "pgsql-performance@postgresql.org" Subject: Re: working around JSONB's lack of stats? References: <54C738E1.8080405@agliodbs.com> <54C93CF2.3020600@2ndquadrant.com> <54C96AAA.9050901@agliodbs.com> <54C973D3.6000808@agliodbs.com> <54CBE902.6000309@agliodbs.com> <54CC3130.5030604@BlueTreble.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 01/30/2015 05:34 PM, Jim Nasby wrote: > On 1/30/15 2:26 PM, Josh Berkus wrote: >> This would probably work because there aren't a lot of data structures >> where people would have the same key:value pair in different locations >> in the JSON, and care about it stats-wise. Alternatetly, if the same >> key-value pair appears multiple times in the same sample row, we could >> cut the MC% by that multiple. > > Even if there were multiple occurrences, this would probably still be an > improvement. > > Another idea... at one time in the past when discussing statistics on > multiple columns, one idea was to build statistics on indexes. If we > built that, we could also do the same thing for at least JSONB (not sure > about JSON). Obviously doesn't help for stuff you haven't indexed, but > presumably if you care about performance and have any significant size > of data you've also indexed parts of the JSON, yes? I'm not clear on what you're suggesting here. I'm discussing how the stats for a JSONB field would be stored and accessed; I don't understand what that has to do with indexing. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance