France-ioi / AlgoreaBackend

Backend for the new Algorea platform
MIT License
1 stars 2 forks source link

Add index to sleed up permissions propagation #1065

Closed GeoffreyHuck closed 5 months ago

GeoffreyHuck commented 5 months ago

Add index in table permissions_propagate on (propagate_to,group_id,item_id).

The first query of the permissions propagation step was very slow, because of the filter on propagate_to. There was an index on propagate_to, but it wasn't used because the rows also had to be filtered by group_id+item_id.

We also remove the old index containing only propagate_to, because the new index can also be used as this (the first column is propagate_to).

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (a5b3c35) to head (11558ab).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1065 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 236 236 Lines 14260 14260 ========================================= Hits 14260 14260 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.