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 1tGxVw-00239t-Nj for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Nov 2024 09:42:17 +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 1tGxVs-005hXg-Iy for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Nov 2024 09:42:13 +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 1tGxVs-005hXS-4G for pgsql-hackers@lists.postgresql.org; Fri, 29 Nov 2024 09:42:13 +0000 Received: from forwardcorp1d.mail.yandex.net ([2a02:6b8:c41:1300:1:45:d181:df01]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGxVp-0007me-WC for pgsql-hackers@lists.postgresql.org; Fri, 29 Nov 2024 09:42:12 +0000 Received: from mail-nwsmtp-smtp-corp-main-26.myt.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-26.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:4fa4:0:640:dbe3:0]) by forwardcorp1d.mail.yandex.net (Yandex) with ESMTPS id C386460A04; Fri, 29 Nov 2024 12:42:08 +0300 (MSK) Received: from smtpclient.apple (unknown [2a02:6b8:82:604:4cdc:ad54:9acd:e7e1]) by mail-nwsmtp-smtp-corp-main-26.myt.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id 6gX4e91IZGk0-BraN460c; Fri, 29 Nov 2024 12:42:08 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1732873328; bh=jB0i68soRs4CtXgw8EsGtkH71P1F7dqfWvzj6mZ4VRU=; h=Message-Id:To:Date:References:Cc:In-Reply-To:From:Subject; b=UNUxYBVdRqbcmB1Bb/7GrqiFOV8fZohO0x6PXCg1Whed+zhV8O4r4ZTFNDyfjxMRs TpXTUNjsA/Uu/seukqRsQAQfg0odS9preTIHa9kyR5i2+SvXx3JfO0AO/odaGJpzSr AWbKHSTEYzDkFkxIyL+ErQE4YDoMw7+1G7Awg8iA= Authentication-Results: mail-nwsmtp-smtp-corp-main-26.myt.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: [PATCH] Add sortsupport for range types and btree_gist From: "Andrey M. Borodin" In-Reply-To: Date: Fri, 29 Nov 2024 14:41:56 +0500 Cc: Bernd Helmle , jian he , PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <52D98799-54D0-4902-A65B-ED3443C7D58C@yandex-team.ru> References: <7C9400DF-66FE-4308-BAD8-92FE3D0E55C6@yandex-team.ru> <0d9fbd59de15e2fc987a850c3d1f8a79a6ede825.camel@oopsware.de> <19c62e62c79b727d2c9a82eaeecfea5017001099.camel@oopsware.de> <4BADF8DD-A4D3-43AA-AA08-037F6FFA40BC@yandex-team.ru> <61128550659807032dd29c8c8a71674c818cbbb6.camel@oopsware.de> <7095B5FA-FADB-4524-B858-ECD14998710B@yandex-team.ru> <0176b173adfcff250543fe0aee2ef6137bd71953.camel@oopsware.de> To: Michael Paquier X-Mailer: Apple Mail (2.3776.700.51) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thanks for your valuable input, Michael! > On 29 Nov 2024, at 09:42, Michael Paquier wrote: >=20 > As a whole, I'm very dubious about the need for injection points at > all here. The sortsupport property claimed for this patch tells that > this results in smaller index sizes, but the tests don't really check > that: they just make sure that sortsupport routine paths are taken. > What this should test is not the path taken, but how the new code > affects the index data generated. Actually, that=E2=80=99s exactly what we wanted to test: which paths are = taken. Resulting index might be of a very same size in case of = B-tree-over-GiST. Resulting index is drastically smaller for geometry, = e.g. PostGIS. But event that=E2=80=99s not main effect: the index is = simply build much faster (on par with actual B-tree). We need this sort support for btree_gist to be able to use non-geometry = datatypes in combination with geometry. e.g. CREATE INDEX ON table USING = gist(project_id_of_type_int,geometric_column); Currently, having anything non-geometric in GiST slows down it 10x, = because sorting build path is not taken. In PG15 we put extra effort to make resulting indexes indistinguishable = from normally-built. Primarily for the sake of IndexScan performance. Best regards, Andrey Borodin.