Searching for IP addresses in the arp API endpoint is horribly inefficient

Bug #1619138 reported by Morten Brekkevold
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
Medium
Morten Brekkevold

Bug Description

IP-based searches using the arp API endpoint are slow. This is because the `ip` filter is subjected to the default handling of Django REST Framework, which produces Django's horrible default search filter for IP address fields: "HOST(ip) = 'someip'". This casts PostgreSQLs INET datatypes to strings, rendering the ip field index unused as sequential table scans are used instead.

The ip field filter should be handled manually, as it is elsewhere in similar NAV code.

Bonus: We can also handle prefix searches in an improved way when this is done.

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
status: Confirmed → Fix Committed
Changed in nav:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.