Apologies, finally got around to getting some data. In a vanilla Ussuri cluster, I ran `openstack network list` with ~1k projects and ~2k projects. @ 1k: runtime was ~6.4 sec @ 2k: runtime was ~17.3 sec ... I then applied: https://review.opendev.org/c/openstack/neutron/+/810072 *Before* the patch, sanity check on indexes: mysql> SHOW INDEX FROM networkrbacs; +--------------+------------+--------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +--------------+------------+--------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | networkrbacs | 0 | PRIMARY | 1 | id | A | 1813 | NULL | NULL | | BTREE | | | | networkrbacs | 0 | uniq_networkrbacs0tenant_target0object_id0action | 1 | action | A | 2 | NULL | NULL | | BTREE | | | | networkrbacs | 0 | uniq_networkrbacs0tenant_target0object_id0action | 2 | object_id | A | 7 | NULL | NULL | | BTREE | | | | networkrbacs | 0 | uniq_networkrbacs0tenant_target0object_id0action | 3 | target_tenant | A | 1877 | NULL | NULL | | BTREE | | | | networkrbacs | 1 | object_id | 1 | object_id | A | 7 | NULL | NULL | | BTREE | | | | networkrbacs | 1 | ix_networkrbacs_project_id | 1 | project_id | A | 1 | NULL | NULL | YES | BTREE | | | +--------------+------------+--------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ mysql> SHOW INDEX FROM qospolicyrbacs; +----------------+------------+------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +----------------+------------+------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | qospolicyrbacs | 0 | PRIMARY | 1 | id | A | 0 | NULL | NULL | | BTREE | | | | qospolicyrbacs | 0 | target_tenant | 1 | target_tenant | A | 0 | NULL | NULL | | BTREE | | | | qospolicyrbacs | 0 | target_tenant | 2 | object_id | A | 0 | NULL | NULL | | BTREE | | | | qospolicyrbacs | 0 | target_tenant | 3 | action | A | 0 | NULL | NULL | | BTREE | | | | qospolicyrbacs | 1 | object_id | 1 | object_id | A | 0 | NULL | NULL | | BTREE | | | | qospolicyrbacs | 1 | ix_qospolicyrbacs_project_id | 1 | project_id | A | 0 | NULL | NULL | YES | BTREE | | | +----------------+------------+------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ mysql> SHOW INDEX FROM securitygrouprbacs; +--------------------+------------+--------------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +--------------------+------------+--------------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | securitygrouprbacs | 0 | PRIMARY | 1 | id | A | 0 | NULL | NULL | | BTREE | | | | securitygrouprbacs | 0 | uniq_securitygrouprbacs0target_tenant0object_id0action | 1 | target_tenant | A | 0 | NULL | NULL | | BTREE | | | | securitygrouprbacs | 0 | uniq_securitygrouprbacs0target_tenant0object_id0action | 2 | object_id | A | 0 | NULL | NULL | | BTREE | | | | securitygrouprbacs | 0 | uniq_securitygrouprbacs0target_tenant0object_id0action | 3 | action | A | 0 | NULL | NULL | | BTREE | | | | securitygrouprbacs | 1 | object_id | 1 | object_id | A | 0 | NULL | NULL | | BTREE | | | | securitygrouprbacs | 1 | ix_securitygrouprbacs_project_id | 1 | project_id | A | 0 | NULL | NULL | YES | BTREE | | | +--------------------+------------+--------------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ mysql> SHOW INDEX FROM addressscoperbacs; +-------------------+------------+----------------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +-------------------+------------+----------------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | addressscoperbacs | 0 | PRIMARY | 1 | id | A | 0 | NULL | NULL | | BTREE | | | | addressscoperbacs | 0 | uniq_address_scopes_rbacs0target_tenant0object_id0action | 1 | target_tenant | A | 0 | NULL | NULL | | BTREE | | | | addressscoperbacs | 0 | uniq_address_scopes_rbacs0target_tenant0object_id0action | 2 | object_id | A | 0 | NULL | NULL | | BTREE | | | | addressscoperbacs | 0 | uniq_address_scopes_rbacs0target_tenant0object_id0action | 3 | action | A | 0 | NULL | NULL | | BTREE | | | | addressscoperbacs | 1 | object_id | 1 | object_id | A | 0 | NULL | NULL | | BTREE | | | | addressscoperbacs | 1 | ix_addressscoperbacs_project_id | 1 | project_id | A | 0 | NULL | NULL | YES | BTREE | | | +-------------------+------------+----------------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ mysql> SHOW INDEX FROM subnetpoolrbacs; +-----------------+------------+-------------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +-----------------+------------+-------------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | subnetpoolrbacs | 0 | PRIMARY | 1 | id | A | 0 | NULL | NULL | | BTREE | | | | subnetpoolrbacs | 0 | uniq_subnetpools_rbacs0target_tenant0object_id0action | 1 | target_tenant | A | 0 | NULL | NULL | | BTREE | | | | subnetpoolrbacs | 0 | uniq_subnetpools_rbacs0target_tenant0object_id0action | 2 | object_id | A | 0 | NULL | NULL | | BTREE | | | | subnetpoolrbacs | 0 | uniq_subnetpools_rbacs0target_tenant0object_id0action | 3 | action | A | 0 | NULL | NULL | | BTREE | | | | subnetpoolrbacs | 1 | object_id | 1 | object_id | A | 0 | NULL | NULL | | BTREE | | | | subnetpoolrbacs | 1 | ix_subnetpoolrbacs_project_id | 1 | project_id | A | 0 | NULL | NULL | YES | BTREE | | | +-----------------+------------+-------------------------------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ There was a KeyError as LEDUC mentions; this is because Ussuri does not have revision c181bb1d89e4; I used e4e236b0e1ff instead. It also does not have table addressgrouprbacs, so I removed that table from the PR. I then ran `sudo -u neutron neutron-db-manage upgrade ba859d649675`. After the patch I see indexes ix_networkrbacs_target_tenant and ix_networkrbacs_action on all tables above. I then reran the `openstack network list` command with ~2k projects; it still took about 17.3 seconds. So adding the indexes provides no benefit, unfortunately.