On 27/2/26 16:00, Attila Soki wrote:
On 27 Feb 2026, at 09:15, Andrei Lepikhov <[email protected]> wrote:
I dont know the inner workings of analyze, is that normal that executing
analyze on unchanged data can flip the plan? Does analyze select a
random set of rows?
Yes, this is completely normal because ANALYZE works in a random way.
You can try using the Join-Order-Benchmark to see how running the
ANALYZE command can change the execution time of the same query,
sometimes by as much as ten times.
--
regards, Andrei Lepikhov,
pgEdge