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 1qsPE5-007ufg-JV for pgsql-docs@arkaria.postgresql.org; Mon, 16 Oct 2023 15:09:49 +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 1qsPE3-001m7M-DL for pgsql-docs@arkaria.postgresql.org; Mon, 16 Oct 2023 15:09:48 +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 1qsPE2-001m6J-Fn for pgsql-docs@lists.postgresql.org; Mon, 16 Oct 2023 15:09:47 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qsPDx-0010Ii-MM for pgsql-docs@lists.postgresql.org; Mon, 16 Oct 2023 15:09:46 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 7B59C5C0443; Mon, 16 Oct 2023 11:09:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 16 Oct 2023 11:09:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1697468980; x=1697555380; bh=K yLcPQWTu8CFtnYcMexOr72/VLf5ItT8tsLpTkBubLs=; b=F1Drw5Z57WbDlQv0E V2Y8ElE1jTRC4DXeV1DpAzsngi14XksmtuZMua69AyS5H5qPcS06N6wwKTQim0sN Z42sabCag26FI53G19y2QlbAe1b5VUlP5u1KWugvmf5D9KI8IdtMQGJMfyPT5LkW sPrIBnuBVLGwGtQmiymc/vs8wVfimGp4vtVO1sNzIf7kK5ULT42bQ4HMStjQLURw d6MCVanz8bswg+OWrEqntT1BwvQZjxrQ3A9UDDbv0Ps3i0A5Pxrb9SREpWwVoMgL m0jEr7F+jY4r0x/B/xZJe4UcwiGVVk0EWe1P5xRalk76E9iFA+WVxnTJC3Aqeblc rdBdw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjedtgdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdeimdenucfjughrpeffhffvuf fkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgr uceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvg hrnhepgeeiieefhefgkeejvdejleduheevgefgffeiveetgefhvdevveeghfeuteehheel necuffhomhgrihhnpehmshhurdhsuhdpvghnthgvrhhprhhishgvuggsrdgtohhmnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghr rhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Oct 2023 11:09:40 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1697468977; bh=jj8UgDEpOfvoLnZUpZPfj7Mu9o8YySfn+aajxZHktuQ=; h=Date:From:To:Subject:In-Reply-To:From; b=HFO1vGatvtf6+njNM+OEsH4N0aJKzno59TxZmTNgoNsbjqAJ3BOx4lsZiMDQs/RTS yZFQ4B7xHskjxbcpyaTwA9j1UQJA3PqQzcZBxSUfeY1iKt9mKM9FqplpIQPj33eY7T nVLzjLwLpTG9IBDywGNJ03MYgbM0Rf4oiu2m33N4HlwnUydiXCNK6/llwQuOIHhNi4 FK8fP1WephIOLEYbjAvngX/joOHEoZTIuKZbRrl0VcTU/k/0Xt5mB6Zfp4kMi2HmWA hi0BVxFhqpa87ZGGPsU+88EPRZuiRvW2Q6fyIq6jpiDgqD2VYnlUdidCypJh3iX2Ht L4wiPG47rGd5A== Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id AD1BD9D; Mon, 16 Oct 2023 17:09:37 +0200 (CEST) Date: Mon, 16 Oct 2023 17:09:37 +0200 From: Alvaro Herrera To: machty@gmail.com, pgsql-docs@lists.postgresql.org Subject: Re: SP-GiST confusing introductory paragraph Message-ID: <202310161509.jeennsgfk5st@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <169742152620.169914.10779838715602285062@wrigleys.postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Oct-16, PG Doc comments form wrote: > I'm confused by this paragraph: > > > These popular data structures were originally developed for in-memory > > usage. In main memory, they are usually designed as a set of dynamically > > allocated nodes linked by pointers. This is not suitable for direct storing > > on disk, since these chains of pointers can be rather long which would > > require too many disk accesses. In contrast, disk-based data structures > > should have a high fanout to minimize I/O. The challenge addressed by > > SP-GiST is to map search tree nodes to disk pages in such a way that a > > search need access only a few disk pages, even if it traverses many nodes. > > In particular, "These popular datastructures" is ambiguous -- based on how > the previous paragraph ends, it sounds like the "popular datastructures" or > SP-GiSTs, but then it goes on to say they were designed for in-memory, and > then it mentions that SP-GiST's space partitioning (with high fanout) is > more appropriate to minimize disk access. I think maybe the solution here > would be to replace "These popular data structures" with something like > "Classic Postgres indexes such as B-tree indexes..." or something like > that. Yeah, this paragraph is a rewording of Oleg's[1] SP-GiST is an abbreviation of space-partitioned GiST - the search tree, which allows to implement a wide range of different non-balanced disk-based data structures, such as quadtree, kd-tree, tries - popular data structures, originally developed for memory storage. Main memory access structures usually designed as a set of dynamically allocated nodes linked by pointers, which is not suitable for direct storing on disk, since these chains of pointers can be rather long and require too many disk accesses. In opposite, disk based data structures have a high fanout to minimize I/O. The challenge is to map nodes of tree to disk pages in such a way, so search algorithm accesses only a few disk pages, even if it traverse many nodes. where the point is (IMO) much clearer. [1] http://www.sai.msu.su/~megera/wiki/spgist_dev > Also, I think a short parenthetical definition of "fanout" would be useful > here, something like "high fanout (i.e. where each node has a potentially > large number of child nodes that reside in the same disk page)". Took me > some googling to realize what fanout meant in this context. Hmm. We also use the term (hypenated as fan-out) in the reference to recursive_worktable_factor. Maybe we should list it in the glossary in a way that works for both. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "La primera ley de las demostraciones en vivo es: no trate de usar el sistema. Escriba un guión que no toque nada para no causar daños." (Jakob Nielsen)