Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZ88l-0003FB-7B for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Dec 2018 05:41:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZ88j-0003Fj-Rv for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Dec 2018 05:41:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZ88j-0003Fc-96 for pgsql-hackers@lists.postgresql.org; Tue, 18 Dec 2018 05:41:57 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZ88f-0001rB-KF for pgsql-hackers@postgresql.org; Tue, 18 Dec 2018 05:41:56 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 15D5521D37D8; Tue, 18 Dec 2018 08:41:51 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.43.27] (unknown [176.59.192.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 7280521D37D6; Tue, 18 Dec 2018 08:41:50 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1545111710; bh=uP9Fcd6i7KDpRbcr1TjbUfDvu4AHL9RPqvFH6rxD67Q=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=dV0iNhgru9f5RhT9v9RW9pycwavSRO4LD4FgoYHfgY+obHYMWQTvxTb4sTT9foewv m3wL+BXBfUn4AhTdq6Hb/SdjOShgeWFni0RTlSq+q1VgH3uQI2I4FmxieR3UqgQzk6 04JuYDmFHIVdtd3m6Wc0uDK50I669sFIJUFwoHHU= Subject: Re: Reduce amount of WAL generated by CREATE INDEX for gist, gin and sp-gist To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: Heikki Linnakangas , a.lubennikova@postgrespro.ru, PostgreSQL-development References: <18f0b868-6888-27eb-22cc-982709c3d0f7@postgrespro.ru> From: Andrey Lepikhov Organization: Postgres Professional Message-ID: <1cdb9c52-e8fb-124b-3949-d3be8a6a7451@postgrespro.ru> Date: Tue, 18 Dec 2018 10:41:48 +0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 30.11.2018 15:10, Dmitry Dolgov wrote: > Thank you. I played a bit with this patch, and can confirm visible WAL size > reduction (it's rather obvious, but still). Although, probably due to lack of > my knowledge here, I wonder how does it work when an index is build > concurrently? Routine generate_xlog_for_rel() works only at phase 2 of concurrent index building. At the phase 3, during validate_index() execution we use aminsert() -> PlaceToPage() mechanism as before the patch. In the concurrent mode, I do not expect any problems, caused by the patch. > >> Benchmarks: >> ----------- >> >> Test: pgbench -f gin-WAL-test.sql -t 5: >> --------------------------------------- >> master: >> Latency average: 27696.299 ms >> WAL size: 2.66 GB > > Does it makes sense to measure latency of the entire script, since it contains > also some preparation work? Of course it still shows the difference between > patched version and master, but probably in a more noisy way. Ok. It is used only for demonstration. -- Andrey Lepikhov Postgres Professional https://postgrespro.com The Russian Postgres Company