improvement(performance): remove unused source/target indices, add index on snapshot id (#1603)

This commit is contained in:
Waleed
2025-10-11 11:28:42 -07:00
committed by waleed
parent 41ec229431
commit e697e50d4e
4 changed files with 6971 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
DROP INDEX "workflow_edges_source_block_idx";--> statement-breakpoint
DROP INDEX "workflow_edges_target_block_idx";--> statement-breakpoint
CREATE INDEX "workflow_execution_logs_state_snapshot_id_idx" ON "workflow_execution_logs" USING btree ("state_snapshot_id");

File diff suppressed because it is too large Load Diff

View File

@@ -680,6 +680,13 @@
"when": 1759963094548,
"tag": "0097_dazzling_mephisto",
"breakpoints": true
},
{
"idx": 98,
"version": "7",
"when": 1760206888564,
"tag": "0098_thick_prima",
"breakpoints": true
}
]
}

View File

@@ -216,8 +216,6 @@ export const workflowEdges = pgTable(
},
(table) => ({
workflowIdIdx: index('workflow_edges_workflow_id_idx').on(table.workflowId),
sourceBlockIdx: index('workflow_edges_source_block_idx').on(table.sourceBlockId),
targetBlockIdx: index('workflow_edges_target_block_idx').on(table.targetBlockId),
workflowSourceIdx: index('workflow_edges_workflow_source_idx').on(
table.workflowId,
table.sourceBlockId
@@ -306,6 +304,9 @@ export const workflowExecutionLogs = pgTable(
(table) => ({
workflowIdIdx: index('workflow_execution_logs_workflow_id_idx').on(table.workflowId),
executionIdIdx: index('workflow_execution_logs_execution_id_idx').on(table.executionId),
stateSnapshotIdIdx: index('workflow_execution_logs_state_snapshot_id_idx').on(
table.stateSnapshotId
),
triggerIdx: index('workflow_execution_logs_trigger_idx').on(table.trigger),
levelIdx: index('workflow_execution_logs_level_idx').on(table.level),
startedAtIdx: index('workflow_execution_logs_started_at_idx').on(table.startedAt),