Files
lasuite-docs/src/backend/core
Manuel Raynaud 7372c4610f ️(backend) optimize media_auth sql queries
On the media_auth endpoint the first bottleneck we have is with
postgresql. We are looking for too much data and no index is used on the
attachments colum. When the lookup filter on the attachement columns, a
full scan is made on all the document table looking for each element in
the array, this operation is really expensive. To fix this we created a
GIN index on the attachments column. Also the readable_per_se lookup was
selecting too much data combined with the filter_descendants function.
We remove the usage of the filter_descendants, we choose to first fetch
all the paths where the attachment is found, this operation is fast
thanks to the new index, split all the paths in candidate paths and then
filter readable_per_se queryset with these paths. All these
modifications make the endpoint faster.
2026-08-20 16:28:31 +02:00
..
2026-08-04 10:16:51 +02:00
2026-08-04 10:16:51 +02:00
2026-03-18 15:04:55 +00:00