askap-vast / vast-pipeline

This repository holds the code of the Radio Transient detection pipeline for the VAST project.
https://vast-survey.org/vast-pipeline/
MIT License
7 stars 3 forks source link

Migrate primary key values on models to UUIDs #683

Open ajstewart opened 1 year ago

ajstewart commented 1 year ago

I've realised recently that migrating the primary keys to UUIDs will potentially have a large benefit in then being able to implement #383 (django-postgres-copy implementation).

Currently the default integer values are used which is fine, but has the complication that it becomes difficult to set primary keys manually. To implement the Postgres copy method - which should significantly speed up the database writing - the primary keys (or at least an index key) should be declared on upload and used for foreign keys. Generating UUIDs would be good for this and is a common practise.

At the moment the index values are returned on the upload step and are used from that point on.

Would have to be a careful migration but might be worth it.