Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W2zSn-0005KI-Gw for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Jan 2014 08:35:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W2zSm-00083s-Pi for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Jan 2014 08:35:08 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W2zSl-00082Y-Fz for pgsql-hackers@postgresql.org; Tue, 14 Jan 2014 08:35:07 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W2zSg-000187-Ju for pgsql-hackers@postgresql.org; Tue, 14 Jan 2014 08:35:05 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id A22F528343; Tue, 14 Jan 2014 00:35:00 -0800 (PST) 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 8E685B04A4; Tue, 14 Jan 2014 00:35:00 -0800 (PST) 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 9EA58C0055; Tue, 14 Jan 2014 00:35:35 -0800 (PST) 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; Tue, 14 Jan 2014 00:35:33 -0800 (PST) Message-ID: <52D4F6B0.4000304@vmware.com> Date: Tue, 14 Jan 2014 10:34:56 +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 part 1: additional information References: <52950F46.2080009@vmware.com> <5298615C.7060102@vmware.com> <5298E834.4090408@vmware.com> <52A58AD5.6030808@vmware.com> <52A62771.3070800@vmware.com> <52AEE445.1060206@vmware.com> <52AF837C.3040201@vmware.com> <52B2F5B0.1030809@vmware.com> <52B49C34.8060300@vmware.com> <52D0A947.6050706@fuzzy.cz> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -7.0 (-------) 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 01/13/2014 07:07 PM, Alexander Korotkov wrote: > I've fixed this bug and many other bug. Now patch passes test suite that > I've used earlier. The results are so: > > Operations time: > event | period > -----------------------+----------------- > index_build | 00:01:47.53915 > index_build_recovery | 00:00:04 > index_update | 00:05:24.388163 > index_update_recovery | 00:00:53 > search_new | 00:24:02.289384 > search_updated | 00:27:09.193343 > (6 rows) > > Index sizes: > label | size > ---------------+----------- > new | 384761856 > after_updates | 667942912 > (2 rows) > > Also, I made following changes in algorithms: > > - Now, there is a limit to number of uncompressed TIDs in the page. > After reaching this limit, they are encoded independent on if they can fit > page. That seems to me more desirable behaviour and somehow it accelerates > search speed. Before this change times were following: > > event | period > -----------------------+----------------- > index_build | 00:01:51.467888 > index_build_recovery | 00:00:04 > index_update | 00:05:03.315155 > index_update_recovery | 00:00:51 > search_new | 00:24:43.194882 > search_updated | 00:28:36.316784 > (6 rows) Hmm, that's strange. Any idea why that's happening? One theory is that when you re-encode the pages more aggressively, there are fewer pages with a mix of packed and unpacked items. Mixed pages are somewhat slower to scan than fully packed or fully unpacked pages, because GinDataLeafPageGetItems() has to merge the packed and unpacked items into a single list. But I wouldn't expect that effect to be large enough to explain the results you got. > - Page are not fully re-encoded if it's enough to re-encode just last > segment. Great! We should also take advantage of that in the WAL record that's written; no point in WAL-logging all the segments, if we know that only last one was modified. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers