robocanic commented on code in PR #1422:
URL: https://github.com/apache/dubbo-admin/pull/1422#discussion_r2901910790


##########
pkg/store/dbcommon/gorm_store.go:
##########
@@ -201,6 +212,11 @@ func (gs *GormStore) Update(obj interface{}) error {
        // Update indices: remove old and add new
        gs.indices.UpdateResource(resource, oldResource.(model.Resource))

Review Comment:
   Suggestion: 
既然用的是DB类型的store,内存的那个index的indices就不用存储了,存储都放到DB里面。也就是DB里面的“resource_indices”这个表即可以存前缀匹配的索引,也可以存全值匹配的索引。



##########
pkg/store/dbcommon/model.go:
##########
@@ -123,3 +123,21 @@ func FromResource(resource model.Resource) 
(*ResourceModel, error) {
                Data:         data,
        }, nil
 }
+
+// ResourceIndexModel represents a persisted index entry in the database
+// This table stores index mappings to enable prefix queries and provide index 
persistence
+// across multiple replicas in distributed deployments
+// Table: resource_indices (shared across all resource kinds)
+type ResourceIndexModel struct {

Review Comment:
   Suggestion:加一列Operator,拓展性会更好



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to