research-software-directory / RSD-as-a-service

This repo contains the new RSD-as-a-service implementation
https://research.software
23 stars 15 forks source link

Slow navigation through backend logs #1092

Closed ewan-escience closed 7 months ago

ewan-escience commented 7 months ago

When the number of backend logs is of order 10000, navigating through them is quite slow. This seems to have two causes:

  1. The function slug_from_log_reference (see here) has as return type a table. As a consequence, it cannot be inlined, as it is used as a scalar function. We should change its return type to VARCHAR.
  2. We ask the table of its size on every request with the header Prefer: count=exact. We should only do this on the first request and accept that the count might not be correct afterwards.