Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WNnf9-0004Ev-L1 for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Mar 2014 18:13:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WNnf9-0004tm-5Y for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Mar 2014 18:13:55 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WNnf8-0004td-23 for pgsql-hackers@postgresql.org; Wed, 12 Mar 2014 18:13:54 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WNnf5-0005R4-HV for pgsql-hackers@postgresql.org; Wed, 12 Mar 2014 18:13:53 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 8326A285B6; Wed, 12 Mar 2014 11:13:48 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 79BDC4031D; Wed, 12 Mar 2014 11:13:48 -0700 (PDT) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 28F82120033; Wed, 12 Mar 2014 11:13:45 -0700 (PDT) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Wed, 12 Mar 2014 11:13:44 -0700 (PDT) Message-ID: <5320A3D9.1010007@vmware.com> Date: Wed, 12 Mar 2014 20:13:45 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: Alexander Korotkov CC: Tomas Vondra , pgsql-hackers Subject: Re: GIN improvements part2: fast scan References: <52E4AA3A.9000607@fuzzy.cz> <52E53458.2010106@vmware.com> <52F36245.6070006@vmware.com> <52F4E094.9040303@vmware.com> <5305CF6E.1080508@vmware.com> <531F8994.3040008@fuzzy.cz> <53208B4D.5000806@vmware.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 03/12/2014 07:42 PM, Alexander Korotkov wrote: > Preparation we do in startScanKey requires knowledge of estimate size of > posting lists/trees. We do this estimate by traversal to leaf pages. I > think gincostestimate is expected to be way more cheap. So, we probably > need so more rough estimate there, don't we? Yeah, maybe. We do something similar for b-tree MIN/MAX currently, but with a lot of keys, it could be a lot more expensive to traverse down to all of them. I wonder if we could easily at least catch the common skewed cases, where e.g the logic of the consistent function is to AND all the keys. The opclass would know that, but we would somehow need to pass down the information to gincostestimate. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers