-- Run select query (involving several CTEs). SELECT ...;
I haven't generated a minimal test case yet, but I did notice that if all CTEs in the SELECT query are defined using AS NOT MATERIALIZED the results are always the same regardless of whether the table has been ANALYZED yet.
Could anyone share knowledge about why this is happening?
A likely scenario is you are missing an ORDER BY in a location where you are depending on deterministic row ordering and its changing out from underneath you.