Joost Kraaijeveld <J.Kraaijeveld@xxxxxxxxxx> writes: > I have a query that if I do "explain" shows an other plan than if I do > "explain analyze" with that same query (immediately after the explain). Really? What PG version is this? Can you provide a self-contained test case? > Does it have to do something with vacuum? In theory an autovacuum happening between the two steps could update the statistics and cause the plan to change, but if it's repeatable then that hardly seems like the explanation. regards, tom lane