Skip to content

Commit 6115a2b

Browse files
fix: add status index to solve search performance issues (#41)
1 parent 7f69036 commit 6115a2b

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

api/src/models/apporderModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const apporderSchema = new Schema(
3636
chainId: ChainIdSchema,
3737
tagArray: TagArraySchema,
3838
remaining: SafeUintSchema,
39-
status: OrderStatusSchema,
39+
status: { ...OrderStatusSchema, index: true },
4040
publicationTimestamp: TimestampSchema,
4141
signer: { ...AddressSchema, index: true },
4242
},

api/src/models/datasetorderModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const datasetorderSchema = new Schema(
4848
chainId: ChainIdSchema,
4949
tagArray: TagArraySchema,
5050
remaining: SafeUintSchema,
51-
status: OrderStatusSchema,
51+
status: { ...OrderStatusSchema, index: true },
5252
publicationTimestamp: TimestampSchema,
5353
signer: { ...AddressSchema, index: true },
5454
},

api/src/models/requestorderModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const requestorderSchema = new Schema(
4343
chainId: ChainIdSchema,
4444
tagArray: TagArraySchema,
4545
remaining: SafeUintSchema,
46-
status: OrderStatusSchema,
46+
status: { ...OrderStatusSchema, index: true },
4747
publicationTimestamp: TimestampSchema,
4848
signer: AddressSchema,
4949
},

api/src/models/workerpoolorderModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const workerpoolorderSchema = new Schema(
3838
chainId: ChainIdSchema,
3939
tagArray: TagArraySchema,
4040
remaining: SafeUintSchema,
41-
status: OrderStatusSchema,
41+
status: { ...OrderStatusSchema, index: true },
4242
publicationTimestamp: TimestampSchema,
4343
signer: { ...AddressSchema, index: true },
4444
},

watcher/src/models/apporderModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const apporderSchema = new Schema(
3636
chainId: ChainIdSchema,
3737
tagArray: TagArraySchema,
3838
remaining: SafeUintSchema,
39-
status: OrderStatusSchema,
39+
status: { ...OrderStatusSchema, index: true },
4040
publicationTimestamp: TimestampSchema,
4141
signer: { ...AddressSchema, index: true },
4242
},

watcher/src/models/datasetorderModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const datasetorderSchema = new Schema(
3737
chainId: ChainIdSchema,
3838
tagArray: TagArraySchema,
3939
remaining: SafeUintSchema,
40-
status: OrderStatusSchema,
40+
status: { ...OrderStatusSchema, index: true },
4141
publicationTimestamp: TimestampSchema,
4242
signer: { ...AddressSchema, index: true },
4343
},

watcher/src/models/requestorderModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const requestorderSchema = new Schema(
4444
chainId: ChainIdSchema,
4545
tagArray: TagArraySchema,
4646
remaining: SafeUintSchema,
47-
status: OrderStatusSchema,
47+
status: { ...OrderStatusSchema, index: true },
4848
publicationTimestamp: TimestampSchema,
4949
signer: AddressSchema,
5050
},

watcher/src/models/workerpoolorderModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const workerpoolorderSchema = new Schema(
3939
chainId: ChainIdSchema,
4040
tagArray: TagArraySchema,
4141
remaining: SafeUintSchema,
42-
status: OrderStatusSchema,
42+
status: { ...OrderStatusSchema, index: true },
4343
publicationTimestamp: TimestampSchema,
4444
signer: { ...AddressSchema, index: true },
4545
},

0 commit comments

Comments
 (0)