[PR #19074] [MERGED] Closes #18191: Remove duplicate SQL indexes #15520

Closed
opened 2025-12-30 00:22:26 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19074
Author: @jeremystretch
Created: 4/3/2025
Status: Merged
Merged: 4/3/2025
Merged by: @jnovinger

Base: featureHead: 18191-remove-duplicate-indexes


📝 Commits (3)

  • c4c95ea Closes #18191: Remove redundant SQL indexes
  • 48ecc25 Update developer documentation
  • b0c5be2 Add a system check for duplicate indexes

📊 Changes

11 files changed (+106 additions, -19 deletions)

View changed files

📝 docs/development/extending-models.md (+1 -1)
📝 netbox/core/apps.py (+1 -0)
netbox/core/checks.py (+41 -0)
netbox/core/migrations/0014_remove_redundant_indexes.py (+25 -0)
📝 netbox/core/models/data.py (+0 -6)
📝 netbox/core/models/files.py (+0 -3)
netbox/dcim/migrations/0207_remove_redundant_indexes.py (+17 -0)
📝 netbox/dcim/models/cables.py (+0 -3)
netbox/vpn/migrations/0009_remove_redundant_indexes.py (+21 -0)
📝 netbox/vpn/models/l2vpn.py (+0 -3)
📝 netbox/vpn/models/tunnels.py (+0 -3)

📄 Description

Fixes: #18191

  • Remove the redundant index declarations from each model
  • Generate migrations
  • Add a note in the developer documentation
  • Introduce a Django system check for duplicate indexes

Note: I did also perform an audit for any additional redundant indexes, but did not uncover any that weren't already listed in #18191.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/19074 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 4/3/2025 **Status:** ✅ Merged **Merged:** 4/3/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `feature` ← **Head:** `18191-remove-duplicate-indexes` --- ### 📝 Commits (3) - [`c4c95ea`](https://github.com/netbox-community/netbox/commit/c4c95ea7bd2e3ef270f24158eb5d57ca248c3879) Closes #18191: Remove redundant SQL indexes - [`48ecc25`](https://github.com/netbox-community/netbox/commit/48ecc2564ac9c174b66408321f66865a76ae4e0c) Update developer documentation - [`b0c5be2`](https://github.com/netbox-community/netbox/commit/b0c5be2e91c5f38586f94843cab215f0550a0eba) Add a system check for duplicate indexes ### 📊 Changes **11 files changed** (+106 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `docs/development/extending-models.md` (+1 -1) 📝 `netbox/core/apps.py` (+1 -0) ➕ `netbox/core/checks.py` (+41 -0) ➕ `netbox/core/migrations/0014_remove_redundant_indexes.py` (+25 -0) 📝 `netbox/core/models/data.py` (+0 -6) 📝 `netbox/core/models/files.py` (+0 -3) ➕ `netbox/dcim/migrations/0207_remove_redundant_indexes.py` (+17 -0) 📝 `netbox/dcim/models/cables.py` (+0 -3) ➕ `netbox/vpn/migrations/0009_remove_redundant_indexes.py` (+21 -0) 📝 `netbox/vpn/models/l2vpn.py` (+0 -3) 📝 `netbox/vpn/models/tunnels.py` (+0 -3) </details> ### 📄 Description ### Fixes: #18191 - Remove the redundant index declarations from each model - Generate migrations - Add a note in the developer documentation - Introduce a Django system check for duplicate indexes Note: I did also perform an audit for any additional redundant indexes, but did not uncover any that weren't already listed in #18191. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:22:26 +01:00
adam closed this issue 2025-12-30 00:22:26 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15520