Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAnYo-000Lmm-2h for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 11:28:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAnYm-005TUr-1B for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 11:28:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAnYm-005TUg-01 for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2026 11:28:32 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wAnYk-000000009ml-3MiF for pgsql-hackers@postgresql.org; Thu, 09 Apr 2026 11:28:32 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-488c2690057so7754295e9.0 for ; Thu, 09 Apr 2026 04:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775734108; x=1776338908; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=027QaC7syk5gIBCJ+DW84ptkUYik9mauuzFeXDYo++M=; b=jRaVOHdXCxp69QJFWwyQPxJN06h/cDhn8kIGPs+kBUykJIil75XFAypZhSle57rIoH FMMh48oXlB4pzl+4bF9JW9SkK5rYP4ZfmoQnioYfmgfZKA4bTeTUscqqXjCW2srCBtOH +zXfuJN9AxNXMrnL/4w2OQ0Vp3QnmoA5BzVBDBkNoaocJ7wtx40VJRTuLsrsvG+8ptX5 V9x4NTSELyks+apk7r7DTcEMyLPOoSRSV5Uhs41R/5zHzz/UVn8nYJnqmzYstUSjBUFd 73rMN+aTAYt+v7LxEV/IPOq8Uyc6Zsu3iJ5SY1wGOuDPVrpMTucTWi8kdPNL1x5Q+q8y 1xKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775734108; x=1776338908; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=027QaC7syk5gIBCJ+DW84ptkUYik9mauuzFeXDYo++M=; b=mBYHd2pCh6CICbih3zsbAL1vSDhx9UDw6iykIiCCzxpk1XZ/wzYB09vjiIdPQpttYb Ig+y1j2GHKGn89Le9SVuNo8QR7v0hiNNtVWbrews5gjaZbEo3f15KgfbuldsNfwci9IP Cb2y53g5ptUTlNiUB+5HgcOjUKgxw+rk8qy7KtwMYRolSlT4i69jTFnAPJR/L8KaTH0Z SYMdyF6PnSUT/dH/Ik3V38Qwaq9AkyztLnjTQCf3meUDuwJaF/lixJ0r+Jt0sn5sRlyK ++pnTGVpH5ov86SKVhhFR5g4aXVXM3Hav7UUq8K4YOGFFvekVPxVcUMBKjCJBKzzTjkH ZbpA== X-Forwarded-Encrypted: i=1; AJvYcCU75k2nmp7tO40R2ZCwdVt0bsUaKx6eQjfCcj2aWq5arCenr+0xZ5HSL+YwXmASj+Uug2+rngBmAlYQedn0@postgresql.org X-Gm-Message-State: AOJu0Yz92YnxRq/pvC1nnbltp4EOfUs5pxlvjdswIP8WV0W8WG+UhR2c NVPuFx2LWFiIAq2lt+tSo5zxgXiMjHkXVx3RnKco1rQP14aJgyLPIf0y X-Gm-Gg: AeBDiet1KVby6OZ8MIORVjuKTdBh+i1uBxo/xxXz8Uk4xZVMQPSWFUc37N/2/W3sh7N zRrvOnsMDmePQD7Aj6yA1SbGM4QUE7HexXZ/pbCdj2YgaqovsQzPBGimImXqhN+Wqa8LXUqD3va VLLypNlu3q8wm9MkkHuTuj1KnuUciAM6Yuk7j6SG+xic0wkDhyIyKg7hrMga+KyrUsU3l9W0A1Y wybi2XkuNF254zfMOM10E+ce1iJuBebpSbnCcRPhDWk9Fzpj53Tdi63bZEoEEoBMcjX45WG2LKL /m2pjy/v5ThtlD6BAkHnCEquhCKDntw31i3RBI/l6i5ckG2ySziqipNDXw6LP2uHp2yQChogNuW /kjXGW9RFyzPVBVYRrVWuvcZstHvHQkJmu4Z+bwba+GDQmJq8jbIpzj6M8yz9ZKJSkQXis92kBX X5vIA2HRJ/vbsvhgTQB0U7dRVxTWl6BRHiczHPIEa5YLK/Ce8K4ZMNsTmVhNBcvExjLXHkMLHKy VWQtVJ61jlSWtUawRNB7W7r2pxDgCsZXaKu9zOQ6vbHmJO9v6lLF1zMIw== X-Received: by 2002:a05:600c:c0dc:b0:485:3193:6ddb with SMTP id 5b1f17b1804b1-488ccf3a0fcmr34692735e9.3.1775734106421; Thu, 09 Apr 2026 04:28:26 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488cd1a8393sm66413385e9.5.2026.04.09.04.28.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2026 04:28:25 -0700 (PDT) Date: Thu, 9 Apr 2026 11:28:24 +0000 From: Bertrand Drouvot To: Heikki Linnakangas Cc: David Geier , Matthias van de Meent , pgsql-hackers Subject: Re: Reduce build times of pg_trgm GIN indexes Message-ID: References: <5d366878-2007-4d31-861e-19294b7a583b@gmail.com> <9ac3931a-180e-4283-a7a8-05eb66099206@iki.fi> <2e11134f-02c3-43da-8c39-fb520a1a251d@iki.fi> <66620ec7-0f81-4813-9cf1-b901a56efcc3@gmail.com> <2a76b5ef-4b12-4023-93a1-eed6e64968f3@gmail.com> <6439c655-e281-409d-b884-6586750d5820@iki.fi> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="U4l+Id+MMy3m7jIo" Content-Disposition: inline In-Reply-To: <6439c655-e281-409d-b884-6586750d5820@iki.fi> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --U4l+Id+MMy3m7jIo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Tue, Apr 07, 2026 at 02:27:40PM +0300, Heikki Linnakangas wrote: > On 03/03/2026 19:31, David Geier wrote: > > > Attached are the patches rebased on latest master. > > > > > > I've removed the ASCII fast-path patch 0006 as it turned out to be more > > > complicated to make work than expected. > > > > > > I kept the radix sort patch because it gives a decent speedup but I > > > would like to focus for now on getting patches 0001 - 0004 merged. > > > They're all simple and, the way I see it, uncontroversial. > > > > > > I remeasured the savings of 0001 - 0004, which comes on top of the > > > already committed patch that inlined the comparison function, which gave > > > another ~5%: > > > > > > Data set | Patched (ms) | Master (ms) | Speedup > > > --------------------|--------------|--------------|---------- > > > movies(plot) | 8,058 | 10,311 | 1.27x > > > lineitem(l_comment) | 223,233 | 256,986 | 1.19x > > > > > > I've also registered the change at the commit fest, see > > > https://commitfest.postgresql.org/patch/6418/. > > > > Attached is v5 that removes an incorrect assertion from the radix sort code. > > > > v5-0001-Optimize-sort-and-deduplication-in-ginExtractEntr.patch > > v5-0002-Optimize-generate_trgm-with-sort_template.h.patch > > v5-0003-Make-btint4cmp-branchless.patch > > v5-0004-Faster-qunique-comparator-in-generate_trgm.patch > > v5-0005-Optimize-generate_trgm-with-radix-sort.patch > > Pushed 0001 as commit 6f5ad00ab7. This commit makes use of StaticAssertStmt() that has been deprecated in d50c86e74375. The attached, fixes it. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com --U4l+Id+MMy3m7jIo Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-gin-change-remaining-StaticAssertStmt-to-StaticAs.patch"