Re: analyze causes query planner to choose suboptimal plan for aselect query in separate transaction - Mailing list pgsql-general

From Michael Lewis
Subject Re: analyze causes query planner to choose suboptimal plan for aselect query in separate transaction
Date
Msg-id CAHOFxGrhmb5HA4AUj2M2fgzAC=Wr8CywbuzV-eDuAu-jpi+TUA@mail.gmail.com
Whole thread Raw
In response to analyze causes query planner to choose suboptimal plan for a selectquery in separate transaction  (Martin Kováčik <kovacik@redbyte.eu>)
Responses Re: analyze causes query planner to choose suboptimal plan for aselect query in separate transaction  (Martin Kováčik <kovacik@redbyte.eu>)
List pgsql-general
I assume it is in the documentation, but I am not aware of how stats are handled for uncommitted work. Obviously in the example you provided the table would be empty, but in your real tests do they start out empty? Would it suffice to use temp tables created like the regular ones and analyze after insert to ensure stats are up to date? Or would it make sense to turn off auto-vacuum/analyze during these tests? The workload is not expected to be similar to real world I would think, and so you don't need the vacuum and the stats update perhaps.

pgsql-general by date:

Previous
From: Martin Kováčik
Date:
Subject: analyze causes query planner to choose suboptimal plan for a selectquery in separate transaction
Next
From: Martin Kováčik
Date:
Subject: Re: analyze causes query planner to choose suboptimal plan for aselect query in separate transaction