Skip to content

Conversation

@arthanson
Copy link
Collaborator

Fixes: #13745

Optimize counter field migration on DeviceType for large databases.

Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this addresses the immediate concern, I'd argue that we should utilize the same approach for all three affected migrations (dcim.0176_device_component_counters and virtualization.0035_virtualmachine_interface_count as well).

Also, we probably want to move the logic from the management command (rather than duplicating it) somewhere internally so that it be can be reused by the migrations.

@arthanson
Copy link
Collaborator Author

While this addresses the immediate concern, I'd argue that we should utilize the same approach for all three affected migrations (dcim.0176_device_component_counters and virtualization.0035_virtualmachine_interface_count as well).

Also, we probably want to move the logic from the management command (rather than duplicating it) somewhere internally so that it be can be reused by the migrations.

Moved the calculate routine to utilities then updated all migrations to use this pattern.

@jeremystretch jeremystretch merged commit b0541be into develop Sep 18, 2023
@jeremystretch jeremystretch deleted the 13745-device-type-migration branch September 18, 2023 13:59
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v3.6 database migration logic is inefficient for large numbers of device types

3 participants