Speed up the events view.

We do this with the help of some denormalisation
and a handy trigger.

Closes #35.
This commit is contained in:
D. Berge
2020-09-14 03:01:55 +02:00
parent b5b91d41c9
commit c9b9a009af
2 changed files with 107 additions and 46 deletions

View File

@@ -48,5 +48,8 @@ if __name__ == '__main__':
db.conn.commit()
# Update the sequences that generate event ids
cur.execute("SELECT reset_events_serials();")
# Let us ensure events_timed_seq is up to date, even though
# the triggers will have taken care of this already.
cur.execute("CALL events_timed_seq_update_all();")
print("Done")