Skip to content

Commit 33f0a4c

Browse files
committed
remove level index
1 parent 98e7184 commit 33f0a4c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

code/go/0chain.net/blobbercore/allocation/allocationchange.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (change *AllocationChange) Save(ctx context.Context) error {
100100

101101
func (change *AllocationChange) Update(ctx context.Context) error {
102102
db := datastore.GetStore().GetTransaction(ctx)
103-
return db.Table(change.TableName()).Where("lookup_hash = ?", change.LookupHash).Updates(map[string]interface{}{
103+
return db.Table(change.TableName()).Where("connection_id = ? AND lookup_hash = ?", change.ConnectionID, change.LookupHash).Updates(map[string]interface{}{
104104
"size": change.Size,
105105
"updated_at": time.Now(),
106106
"input": change.Input,
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
-- +goose Up
22
-- +goose StatementBegin
3-
DROP INDEX idx_created_at,idx_updated_at,idx_lookup_hash,path_idx,idx_path_gin_trgm,idx_name_gin,idx_path_alloc;
4-
CREATE INDEX idx_allocation_path ON reference_objects USING btree(allocation_id,path,level);
3+
DROP INDEX idx_created_at,idx_updated_at,idx_lookup_hash,path_idx,idx_path_gin_trgm,idx_name_gin,idx_allocation_changes_lookup_hash;
54
-- +goose StatementEnd

0 commit comments

Comments
 (0)