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

Method pgsql_actual_time

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

Source from the content-addressed store, hash-verified

176 return 0
177
178 def pgsql_actual_time(self, sql):
179 try:
180 #success, res = self.execute_sql('explain (FORMAT JSON, analyze) ' + sql)
181 success, res = self.execute_sql('explain (FORMAT JSON, analyze) ' + sql)
182 if success == 1:
183 cost = res[0][0][0]['Plan']['Actual Total Time']
184 return cost
185 else:
186 return -1
187 except Exception as error:
188 logging.error('pgsql_actual_time Exception', error)
189 return -1
190
191 def mysql_cost_estimation(self, sql):
192 try:

Callers

nothing calls this directly

Calls 1

execute_sqlMethod · 0.95

Tested by

no test coverage detected