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

Method pgsql_actual_time

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

Source from the content-addressed store, hash-verified

153 return 0
154
155 def pgsql_actual_time(self, sql):
156 try:
157 #success, res = self.execute_sql('explain (FORMAT JSON, analyze) ' + sql)
158 success, res = self.execute_sql('explain (FORMAT JSON, analyze) ' + sql)
159 if success == 1:
160 cost = res[0][0][0]['Plan']['Actual Total Time']
161 return cost
162 else:
163 return -1
164 except Exception as error:
165 logging.error('pgsql_actual_time Exception', error)
166 return -1
167
168 def mysql_cost_estimation(self, sql):
169 try:

Callers

nothing calls this directly

Calls 1

execute_sqlMethod · 0.95

Tested by

no test coverage detected