Files
ubicloud/lib/authorization.rb
Jeremy Evans 954d439b30 Avoid correlated subquery in authorization query
I'm not sure if PostgreSQL would correctly optimize the correlated
subquery, so this switches back to a pure join approach.  This
puts all conditions in the JOINs, avoiding the use of WHERE.

When we move to supporting personal access tokens, this should
be trivial to expand to multiple subjects (both account and
personal access token subjects) in a single query, using a loop
for the subject joins over all provided subjects.

This is similar in nature to the original SQL query, before it
was switched to a correlated subquery, but the joins are in a
different order.
2024-11-21 12:58:56 -08:00

5.9 KiB