[PR #13610] [MERGED] Fixes #13605: Specify batch size for cached counter migrations #14224

Closed
opened 2025-12-29 23:23:16 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/13610
Author: @jeremystretch
Created: 8/30/2023
Status: Merged
Merged: 8/30/2023
Merged by: @jeremystretch

Base: featureHead: 13605-optimize-migration


📝 Commits (2)

  • 99140a9 Specify batch size for cached counter migrations
  • 8e6b62b Remove list() casting of querysets

📊 Changes

3 files changed (+7 additions, -7 deletions)

View changed files

📝 netbox/dcim/migrations/0176_device_component_counters.py (+3 -3)
📝 netbox/dcim/migrations/0178_virtual_chassis_member_counter.py (+2 -2)
📝 netbox/virtualization/migrations/0035_virtualmachine_interface_count.py (+2 -2)

📄 Description

Fixes: #13605

Add batch_size=100 to the bulk_update() calls in the cached counter migrations, to avoid very large SQL queries.


🔄 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/13610 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 8/30/2023 **Status:** ✅ Merged **Merged:** 8/30/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `13605-optimize-migration` --- ### 📝 Commits (2) - [`99140a9`](https://github.com/netbox-community/netbox/commit/99140a941328646001bcd2a04ae8f0c8221d77d5) Specify batch size for cached counter migrations - [`8e6b62b`](https://github.com/netbox-community/netbox/commit/8e6b62bfd9bcd559f149949163ce43657551ae31) Remove list() casting of querysets ### 📊 Changes **3 files changed** (+7 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/migrations/0176_device_component_counters.py` (+3 -3) 📝 `netbox/dcim/migrations/0178_virtual_chassis_member_counter.py` (+2 -2) 📝 `netbox/virtualization/migrations/0035_virtualmachine_interface_count.py` (+2 -2) </details> ### 📄 Description ### Fixes: #13605 Add `batch_size=100` to the `bulk_update()` calls in the cached counter migrations, to avoid very large SQL queries. --- <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-29 23:23:16 +01:00
adam closed this issue 2025-12-29 23:23:16 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14224