Re: ltree docs imprecise about sorting order

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: "pierre(at)vennin(dot)net" <pierre(at)vennin(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ltree docs imprecise about sorting order
Date: 2024-10-17 01:26:03
Message-ID: CAKFQuwbjx5yHLqb1H5obUiys4+6os6jmN3L_cC2jkjW-yB8xGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

On Wednesday, October 16, 2024, Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> On Thu, May 23, 2024 at 04:17:50PM +0000, PG Doc comments form wrote:
> > The following documentation comment has been logged on the website:
> >
> > Page: https://www.postgresql.org/docs/16/ltree.html
> > Description:
> >
> > The ltree docs available at
> > https://www.postgresql.org/docs/current/ltree.html state "Comparison
> sorts
> > in the order of a tree traversal" without specifying the strategy
> > implemented to walk the tree.
> > A quick experiment suggests that the implemented solution is pre-ordered
> > depth-first search.
> > I suggest the ltree docs be amended to "Comparison sorts in the order of
> a
> > pre-ordered depth-first tree traversal".
>
> [ moved to hackers ]
>
> Can someone confirm this and/or create a patch?
>

If we are going to update the description of sorting we should probably
take the chance to mention collation, or I believe the lack thereof.
Including an example with order by wouldn’t hurt either.

The example data is also a perfect tree, all intermediate nodes exist as
their own rows. It may be informative to include exceptions to this rule.

David J.

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2024-10-17 01:36:00 Re: Connection Info
Previous Message Bruce Momjian 2024-10-17 01:20:41 Re: Logical replication - initial data synchronization

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrei Lepikhov 2024-10-17 02:09:29 Re: POC, WIP: OR-clause support for indexes
Previous Message David Rowley 2024-10-17 01:25:51 Re: Fixing Hash Join bug I caused with adf97c156