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 1wCJ7B-001r6k-05 for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2026 15:22:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCJ79-007dwk-0E for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Apr 2026 15:22:15 +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 1wCJ78-007dwY-2W for pgsql-hackers@lists.postgresql.org; Mon, 13 Apr 2026 15:22:15 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wCJ77-00000000onU-2Hzj for pgsql-hackers@postgresql.org; Mon, 13 Apr 2026 15:22:14 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-488af96f6b2so61305115e9.0 for ; Mon, 13 Apr 2026 08:22:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776093732; x=1776698532; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=EHXPHLDpx5038CLSr28YaBbPIIw0Tyoix8J0rBOGTSU=; b=UWuOUaJjJweofYzzWQ+5IXWyotOar0qkoCklU4LDw5N1PeJAUjXgr+0xZf9DJt2DGA uwS4h1KX/WY43Wlr2WDQwEMX87m/Ut5CKdBXhppA50Cbt/aAfqJlwnZLmr4yVeLMpb8x 966RFoGYr/JyZMT00TnpVYao/X254+B9XJw8FNS+y5ar0BlfLekjSuzclpFgbfZ45ToB iAB4lwWfQCwNq+CC9EU4v3EWzz9wxsH5dUZfwmXG8NkVO/q8121vpLsF67PZ256EyHOY NKdlxP9P+yZrjTfPmNyTMmdTLbUceFzvfCGGiEr6LtvmS9TXtmM3Eh+pvS0b14psGCKg vhTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776093732; x=1776698532; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EHXPHLDpx5038CLSr28YaBbPIIw0Tyoix8J0rBOGTSU=; b=BxVOyAmaR/E/p26UakCRCaaFWl1qrQkBhU9SbNk1pewyE1+hpNS3zQYJhIoe3b+/yO WyWd1ESsYdUHMifTGtw/HG0KPAUfaTVsGfD8f99B+n+00irPCZjmY76XkspTmK1CYw3D 8Ly4UzbvHAdT9O1K5KS63MZyPCwIBDnx+fjmwSFLyY8GCaKBTMYShA/aBXEClqoxE6w6 +y+BD0dEU0A51dUGf/stw2FUI5BIcs62Oi/hThZDz4ngvJ6v6P/jDYNaGehUAL6KURBc /hgMjxDc3eYmactmKEMMktkBnEr6hzxW4bpd54l+lW1s619juLZyvXcR7JTUbaNgdfX0 1zjw== X-Forwarded-Encrypted: i=1; AFNElJ+BAstXkeO/LeZ7Zm3FoGn4DMsDPtiUphjXNblwqgaaERT81ZmkmqhgYzyP/uqbeMB7rmsjy6RUW+A6dH2J@postgresql.org X-Gm-Message-State: AOJu0Yy0MGBosyxWdnWU+BX4mvImuMmEd52VBcvrAm44U+/zHUtRcfSU DkSlmbUFxZq9VsWA7t6F3jRrtsZxMxJnz+Ud+NK+YY16Vv439aqGl5YF X-Gm-Gg: AeBDievCULHVj3I8yYmbOJajtpMpiEVEWMSd1bR9QLh/QDey2YUEg/jzIvZ6BJk1Yfa f4UXAkVIp7PuzqK/wnq1gZvbNMJnbQFZ6s4++ArxQ05ckkkWBjIjGls8ndEbB5IfPgEXHPhVB7x alkakjRuWG4AaJX8fFZOnD0a6e4mlmSil+YGhRbeClknPwnYZ/A8+Ole84l/xiRExFPJt6Jh+0Q wcF3IEut11F8OuzvMR/+qCP0o1PBO41lF1WBhLj1LHbJlLbLf5icb2RpP4xKyNKICWJY1+OINWk OoEKMWDMWVWqaCPbF1GMoi7f+Tkd0TM4v0qsEL3pqcpN9lFIMjiNm7vRzq6HFQi549GTm7zSuZ/ AY9nn+22HaAtuh03Nn6ek/4fV6AuVdozCS7qs0hPe8kvljJSoAqAqdNcIz1EAAWnbLKvLrDKyWv 6grTgkSb+AcwCa3wMgG+UXp4I1ZA== X-Received: by 2002:a05:600c:c0da:b0:488:b187:d898 with SMTP id 5b1f17b1804b1-488d685b6e8mr163740325e9.14.1776093732377; Mon, 13 Apr 2026 08:22:12 -0700 (PDT) Received: from [172.31.5.233] ([147.161.235.32]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488d58bb830sm311438195e9.7.2026.04.13.08.22.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Apr 2026 08:22:11 -0700 (PDT) Message-ID: <27e8142d-19da-48a8-8eac-7b2e117dc463@gmail.com> Date: Mon, 13 Apr 2026 17:22:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Reduce build times of pg_trgm GIN indexes To: Tom Lane , Heikki Linnakangas Cc: Matthias van de Meent , pgsql-hackers 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> <342012.1776017102@sss.pgh.pa.us> Content-Language: en-US From: David Geier In-Reply-To: <342012.1776017102@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12.04.2026 20:05, Tom Lane wrote: > Heikki Linnakangas writes: >> Pushed 0001 as commit 6f5ad00ab7. > > This commit has caused Coverity to start complaining that > most of ginExtractEntries() is unreachable: > > *** CID 1691468: Control flow issues (DEADCODE) > /srv/coverity/git/pgsql-git/postgresql/src/backend/access/gin/ginutil.c: 495 in ginExtractEntries() > 489 /* > 490 * Scan the items for any NULLs. All NULLs are considered equal, so we > 491 * just need to check and remember if there are any. We remove them from > 492 * the array here, and after deduplication, put back one NULL entry to > 493 * represent them all. > 494 */ >>>> CID 1691468: Control flow issues (DEADCODE) >>>> Execution cannot reach this statement: "hasNull = false;". > 495 hasNull = false; > 496 if (nullFlags) > 497 { > 498 int32 numNonNulls = 0; > 499 > 500 for (int32 i = 0; i < nentries; i++) > > Evidently, it does not realize that the extractValueFn() can change > nentries from its initial value of zero. I wouldn't be too surprised > if that's related to our casting of the pointer to uintptr_t --- that > may cause it to not see the passed pointer as a potential reference > mechanism. Curious that we don't see that more frequently for other functions that have output arguments. But maybe there are just too few? > I would just write that off as Coverity not being smart enough, except > that I'm worried that some compiler might make a similar deduction and > break the function completely. Was the switch to a local variable > for nentries really a useful win performance-wise? I haven't benchmarked the variant with using the pointer directly. I can do that. -- David Geier