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

Method get_mysql_total_cost

bmtools/tools/database/utils/database.py:180–191  ·  view source on GitHub ↗
(self, total_cost, res)

Source from the content-addressed store, hash-verified

178 return -1
179
180 def get_mysql_total_cost(self, total_cost, res):
181 if isinstance(res, dict):
182 if 'query_cost' in res.keys():
183 total_cost += float(res['query_cost'])
184 else:
185 for key in res:
186 total_cost += self.get_mysql_total_cost(0, res[key])
187 elif isinstance(res, list):
188 for i in res:
189 total_cost += self.get_mysql_total_cost(0, i)
190
191 return total_cost
192
193 def get_tables(self):
194 if self.args.dbtype == 'mysql':

Callers 1

mysql_cost_estimationMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected