Print optimization steps

Prints the various steps on stdout, quite nice to
be able to understand what is happening internally.
master
Salvo 'LtWorf' Tomaselli 2016-01-03 19:47:53 +07:00
parent ce348149f1
commit ba8453c923
1 changed files with 8 additions and 1 deletions

@ -153,10 +153,17 @@ class relForm(QtWidgets.QMainWindow):
res_rel,query = self.user_interface.split_query(self.ui.txtQuery.text(),None)
try:
trace = []
result = optimizer.optimize_all(
query,
self.user_interface.relations
self.user_interface.relations,
debug=trace
)
print('==== Optimization steps ====')
print(query)
print('\n'.join(trace))
print('========')
if res_rel:
result = '%s = %s' % (res_rel, result)
self.ui.txtQuery.setText(result)