MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / pgsql_query_plan

Method pgsql_query_plan

bmtools/tools/db_diag/utils/database.py:150–162  ·  view source on GitHub ↗
(self, sql)

Source from the content-addressed store, hash-verified

148 return "<fail>"
149
150 def pgsql_query_plan(self, sql):
151 try:
152 #success, res = self.execute_sql('explain (FORMAT JSON, analyze) ' + sql)
153 success, res = self.execute_sql('explain (FORMAT JSON) ' + sql)
154 if success == 1:
155 plan = res[0][0][0]['Plan']
156 return plan
157 else:
158 logging.error('pgsql_query_plan Fails!')
159 return 0
160 except Exception as error:
161 logging.error('pgsql_query_plan Exception', error)
162 return 0
163
164 def pgsql_cost_estimation(self, sql):
165 try:

Callers

nothing calls this directly

Calls 1

execute_sqlMethod · 0.95

Tested by

no test coverage detected