diff --git a/bin/datastore.py b/bin/datastore.py index 2ec5b3a..cb1f52e 100644 --- a/bin/datastore.py +++ b/bin/datastore.py @@ -679,6 +679,21 @@ class Datastore: # We do not commit if we've been passed a cursor, instead # we assume that we are in the middle of a transaction + def adjust_planner(self, cursor = None): + """ + Adjust estimated times on the planner + """ + if cursor is None: + cur = self.conn.cursor() + else: + cur = cursor + + qry = "CALL adjust_planner();" + cur.execute(qry) + if cursor is None: + self.maybe_commit() + # We do not commit if we've been passed a cursor, instead + # we assume that we are in the middle of a transaction def housekeep_event_log(self, cursor = None): """ diff --git a/bin/housekeep_database.py b/bin/housekeep_database.py index 46f5af0..5b1fc4c 100755 --- a/bin/housekeep_database.py +++ b/bin/housekeep_database.py @@ -20,6 +20,7 @@ if __name__ == '__main__': print(f'Survey: {survey["id"]} ({survey["schema"]})') db.set_survey(survey["schema"]) + db.adjust_planner() db.housekeep_event_log() print("Done")