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.94.2) (envelope-from ) id 1setAc-00Dfud-1G for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Aug 2024 09:22:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1setAa-003yWI-Iy for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Aug 2024 09:22:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1setAZ-003yWA-UB for pgsql-hackers@lists.postgresql.org; Fri, 16 Aug 2024 09:22:52 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1setAX-0057vV-LB for pgsql-hackers@lists.postgresql.org; Fri, 16 Aug 2024 09:22:51 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 3F42924000A; Fri, 16 Aug 2024 09:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vondra.me; s=gm1; t=1723800167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cGBqlJEtgHk9G7IPH3p5hGYpazF4m8tdSsgdrVYiUdo=; b=V9KrtYuyfgFDHeTA+YT8V3mY36telrkf1yur0cfen3a+qsHo5c/Mct4UbN5gdOnetFEcNX A03/H/979/45RygHBVPcz/HHYzjqgjvW9TiZ9gGStKJf3DWeGK9TlkM1MBNazUgQF02QuU ydh7iiMpnJjn0eFw/OCskx9bo0h5ZVsHI3mSXsSMiiVLPl2oP9k62S0P4YtRgqUTcTSdLe gCeeTRNyTk64AyQrMY4X+MxbheuZF7lAfEJw3BA4VnjwvctSFdczjq91b0Kl3bh2OR0wP5 83okMhIe6I84vTXZYFf68n5Uip8DvK6DOqFh3aQs6dyeQ8F5k9looRlbmqT/HA== Message-ID: <618bc573-a0df-4ea9-bb71-aecff104c5f5@vondra.me> Date: Fri, 16 Aug 2024 11:22:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Parallel CREATE INDEX for BRIN indexes To: Peter Eisentraut Cc: Andres Freund , Matthias van de Meent , PostgreSQL Hackers References: <99f9ecbe-0976-8012-67b5-dbff58c7dbec@enterprisedb.com> <32e3f645-389d-87f9-2ce7-33d0087f47d4@enterprisedb.com> <3733d042-71e1-6ae6-5fac-00c12db62db6@enterprisedb.com> <20240413083635.47yve2c5pp2xt5b6@awork3.anarazel.de> <4a9c0545-6697-47d3-bf7c-2f5d0d7a7319@enterprisedb.com> <1df00a66-db5a-4e66-809a-99b386a06d86@enterprisedb.com> <86763810-70a1-4872-8ba7-1676f788e5a2@eisentraut.org> Content-Language: en-US From: Tomas Vondra In-Reply-To: <86763810-70a1-4872-8ba7-1676f788e5a2@eisentraut.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: tomas@vondra.me List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/15/24 15:48, Peter Eisentraut wrote: > On 13.04.24 23:04, Tomas Vondra wrote: >>>> While preparing a differential code coverage report between 16 and >>>> HEAD, one >>>> thing that stands out is the parallel brin build code. Neither on >>>> coverage.postgresql.org nor locally is that code reached during our >>>> tests. >>>> >>> >>> Thanks for pointing this out, it's definitely something that I need to >>> improve (admittedly, should have been part of the patch). I'll also look >>> into eliminating the difference between BTREE and BRIN parallel builds, >>> mentioned in my last message in this thread. >>> >> >> Here's a couple patches adding a test for the parallel CREATE INDEX with >> BRIN. The actual test is 0003/0004 - I added the test to pageinspect, >> because that allows cross-checking the index to one built without >> parallelism, which I think is better than just doing CREATE INDEX >> without properly testing it produces correct results. > > These pageinspect tests added a new use of the md5() function.  We got > rid of those in the tests for PG17.  You could write the test case with > something like > >  SELECT (CASE WHEN (mod(i,231) = 0) OR (i BETWEEN 3500 AND 4000) THEN > NULL ELSE i END), > -       (CASE WHEN (mod(i,233) = 0) OR (i BETWEEN 3750 AND 4250) THEN > NULL ELSE md5(i::text) END), > +       (CASE WHEN (mod(i,233) = 0) OR (i BETWEEN 3750 AND 4250) THEN > NULL ELSE encode(sha256(i::text::bytea), 'hex') END), >         (CASE WHEN (mod(i,233) = 0) OR (i BETWEEN 3850 AND 4500) THEN > NULL ELSE (i/100) + mod(i,8) END) > > But this changes the test output slightly and I'm not sure if this gives > you the data distribution that you need for you test.  Could your check > this please? > I think this is fine. The output only changes because sha256 produces longer values than md5, so that the summaries are longer the index gets a page longer. AFAIK that has no impact on the test. regards -- Tomas Vondra