News for hackers. Stuff that matters.
Re:Performant database tree traversal with Rails by zomgwat on Wednesday July 12, 2023 @09:34PM (#36704029)
As of PostgreSQL 12, whether the optimization fence is used or not is controlled with MATERIALIZED and NOT MATERIALIZED.
Re:Performant database tree traversal with Rails by srcreigh on Wednesday July 12, 2023 @10:32PM (#36704372)
By default it’s an optimization fence if a CTE is referenced 2+ times, and not an optimization fence if referenced 0-1 times. The MATERIALIZED and NOT MATERIALIZED overrides the default.