Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UpD7q-0001XG-GM for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jun 2013 07:48:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UpD7p-0005EQ-Ub for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jun 2013 07:48:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UpD7o-0005Cn-4J for pgsql-hackers@postgresql.org; Wed, 19 Jun 2013 07:48:16 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UpD7k-0006Lh-PU for pgsql-hackers@postgresql.org; Wed, 19 Jun 2013 07:48:15 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 9EF35286AC; Wed, 19 Jun 2013 00:48:09 -0700 (PDT) Received: from zcs-prod-ext-mta-2.vmware.com (zcs-prod-ext-mta-2.vmware.com [10.113.62.224]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 9C3BBB09A0; Wed, 19 Jun 2013 00:48:09 -0700 (PDT) Received: from zcs-prod-ext-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id 24D1CC005D; Wed, 19 Jun 2013 00:48:02 -0700 (PDT) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTPSA; Wed, 19 Jun 2013 00:48:00 -0700 (PDT) Message-ID: <51C16235.3080308@vmware.com> Date: Wed, 19 Jun 2013 10:48:05 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: Alexander Korotkov CC: pgsql-hackers Subject: Re: GIN improvements part2: fast scan References: <51BF0A90.2000503@vmware.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -8.2 (--------) 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 18.06.2013 23:59, Alexander Korotkov wrote: > I would like to illustrate that on example. Imagine you have fulltext query > "rare_term& frequent_term". Frequent term has large posting tree while > rare term has only small posting list containing iptr1, iptr2 and iptr3. At > first we get iptr1 from posting list of rare term, then we would like to > check whether we have to scan part of frequent term posting tree where iptr > < iptr1. So we call pre_consistent([false, true]), because we know that > rare term is not present for iptr< iptr2. pre_consistent returns false. So > we can start scanning frequent term posting tree from iptr1. Similarly we > can skip lags between iptr1 and iptr2, iptr2 and iptr3, from iptr3 to > maximum possible pointer. Thanks, now I understand the rare-term & frequent-term problem. Couldn't you do that with the existing consistent function? I don't see why you need the new pre-consistent function for this. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers