acoustic-carpenter-78188
10/10/2025, 11:09 PMgorm:"type:uuid;index:tags_dataset_uuid_idx"
+ ArtifactID string gorm:"index:tags_dataset_uuid_artifact_id_idx,priority:2"
+ DatasetUUID string gorm:"type:uuid;index:tags_dataset_uuid_idx;index:tags_dataset_uuid_artifact_id_idx,priority:1"
### How this fixes the issue:
• Introduces a composite index named tags_dataset_uuid_artifact_id_idx.
• Sets index priority for DatasetUUID (1) and ArtifactID (2) to ensure optimal ordering for typical query patterns.
• Addresses #4583 by improving query efficiency without changing existing schema behavior.
## How was this patch tested?
### Labels
• changed: For changes in existing functionality.
• fixed: For any bug fixed.
This is important to improve the readability of release notes.
### Setup process
No special setup required. Run database migrations after updating Flyte to apply the new index.
### Screenshots
N/A — schema-level optimization.
## Check all the applicable boxes
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
## Related PRs
N/A
## Docs link
N/A — this change affects backend model definitions only and does not modify public APIs or user-facing documentation.
https://bito.ai#summarystart|
### Summary by Bito
This pull request introduces a composite index on the DatasetUUID and ArtifactID fields in the tags model, significantly enhancing query performance and addressing inefficiencies in database lookups. The changes aim to optimize query execution and reduce latency in database operations.
flyteorg/flyteacoustic-carpenter-78188
10/15/2025, 6:10 AM