Open sickelap opened 1 year ago
Just a heads-up, most of these queries improved the performance. It would be nice if that could stay that way when we switch to ORM.
https://github.com/LibrePhotos/librephotos/pull/499 https://github.com/LibrePhotos/librephotos/pull/193
If I missed a relevant query, it should be easy to figure out the context with git blame :)
I am willing to take this up. Looks like this would be a big PR. We can start with an initial PR with one or 2 queries changed to ORM and test and compare the performance(using silk) . How does it sound to you @derneuere ?
Sounds like a good approach! Please test big datasets and try to coordinate your work with @sickelap. I think he also wants to work on those queries :)
Convert all raw SQL queries in backend to Django ORM, so we could be database agnostic. There are some queries that are not portable to SQLite3, e.g., some
jsonb_*
functions. Ideally, this would be done with some form of translation layer to shield the framework from the application, but that's too big of a scope I think.