News for hackers. Stuff that matters.
Re:The surprisingly difficult problem of user-defined order ... by barrkel on Friday January 15, 2021 @10:52PM (#25799871)
Recursive CTEs are an excellent way to write a very slow query.

You save the cost of network round trips, parsing the query, optimizing the join order etc., but your recursive CTE is otherwise executed once per iteration. For trees, that's typically the depth; for linked lists, it'll be the length of the list. In practice they both suck, and will be trivially outperformed by almost any other technique.

Re:The surprisingly difficult problem of user-defined order ... by andreareina on Saturday January 16, 2021 @01:29AM (#25800533)
A linked list is a degenerate tree, after all