perf: optimizing db WorkflowAppLog index (#14710)

This commit is contained in:
horochx 2025-03-30 13:17:23 +08:00 committed by GitHub
parent aa4c6874f1
commit a91b780936
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -755,7 +755,8 @@ class WorkflowAppLog(Base):
__tablename__ = "workflow_app_logs"
__table_args__ = (
db.PrimaryKeyConstraint("id", name="workflow_app_log_pkey"),
db.Index("workflow_app_log_app_idx", "tenant_id", "app_id"),
db.Index("workflow_app_log_app_idx", "tenant_id", "app_id", "created_at"),
db.Index("workflow_app_log_workflow_run_idx", "workflow_run_id"),
)
id: Mapped[str] = mapped_column(StringUUID, server_default=db.text("uuid_generate_v4()"))