Project

General

Profile

Actions

Bug #25788

open

Redundant taxonomy enumeration causes significant performance degradation.

Added by Shimon Shtein about 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

In used_organization_ids and used_location_ids a call to get_taxonomy_ids is used with which_organization/which_location sent in as a parameter respectively. It looks like which_location already contains all sub-locations and needs not to be expanded further. Each expansion like this causes another sql query per each sub-location.

How to reproduce:

Create a big locations tree with 3 root nodes:

America
USA
LA
WA
NY
Canada
...
Europe
Asia

Assign around 100 subnets to a single sub-loc (for example LA)

Now add only LA to a non-admin user.
Perform api/v2/subnets query with this user.

Clone the user, but add to it all three root locations (America, Europe, Asia).
Perform api/v2/subnets query with the cloned user.

Observe time difference between requests

No data to display

Actions

Also available in: Atom PDF