The assignment call list_projects_for_user() is commonly used - not least every time you issue a scoped token. Ina test configuration, this method was consuming 36% of all keystone clock time. This call searches the assignments table (which has one row for every assignment, so could be very large in enterprise situations) by actor_id. Although actor_id is part of a composite primary key, when used alone it is like any other non-indexed column.
Adding an index for actor ID would significantly improve performance, and since the read frequency of such a table is probably much greater than new role assignments being added, this seems like a good trade-off.
Such an index would also improve the performance of get role_assignments, when used to get role assignments for a user - which would seem a likely common usage pattern
Fix proposed to branch: master /review. openstack. org/117541
Review: https:/