Closed GeoffreyHuck closed 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
c13c47a
) to head (6111074
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
fixes #1050
The query is very weird (and still is).
We already know the path, it's given in the URL. We need only to know if it's valid.
The written query seems to do something else: finding all possible paths and then matching the path we want.
So I added the constraints of the path in the query (
visible_items
restricted to the ids in the path, we don't need ALL visible items of the current user), and set the ids of the items in the path, because we know them.We can probably do even better by rewriting the query, if we need to, because it's confusing.
It takes ~1s now on preprod.
Still no clue about the difference between prepared query and directly query ran directly
Still no clue. Today the query took longer even in console. I ran
ANALYZE TABLE xxx
recently on some tables, maybe it's related, but then it should be faster, not slower. BUT I didEXPLAIN
on the two, and the result is different: prepared queries can have a different execution plan than queries run directly.Even with the
EXPLAIN
I still couldn't find exactly what was so slow.