Re: analyze causes query planner to choose suboptimal plan for a select query in separate transaction

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Martin Kováčik <kovacik(at)redbyte(dot)eu>
Cc: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: analyze causes query planner to choose suboptimal plan for a select query in separate transaction
Date: 2019-04-25 15:25:34
Message-ID: CAHOFxGrhmb5HA4AUj2M2fgzAC=Wr8CywbuzV-eDuAu-jpi+TUA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martin Kováčik 2019-04-25 17:33:48 Re: analyze causes query planner to choose suboptimal plan for a select query in separate transaction
Previous Message Martin Kováčik 2019-04-25 14:37:46 analyze causes query planner to choose suboptimal plan for a select query in separate transaction