Commit 1dd32da6 authored by Marcin's avatar Marcin
Browse files

report explain analyze to log for given queries

If some SQL query is suspected to will need be explained and analyzed in the future, then instead of
call queries directly on Db instance call the same query on AutoExplainWrapper
returned from the Db with method explain(). AutoExplainWrapper has the
same query interface as the Db class has, so the call is identical in
both cases.
For example previously query executed without plan explanation:
	db.query_row(sql)
can be capable to explain with:
	db.explain().query_row(sql)

Because taking plan explanation requires SUPERUSER privileges and
adds additional overhead for the queries, by default AutoExplainWrapper
is not used, explain() function simply returns the Db class instance.
To include plan explanation in the log hivemind has to be started
with parameter --log_explain_queries=true and connected to the
postgres db using role with SUPERUSER privileges.

include information from vacuum analyze hive posts in the log
parent 91085b32
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment