Index lifecycle capacity checks instead of scanning retained jobs
This commit is contained in:
@@ -44,6 +44,8 @@ export function ensureHostSchema(handle: Database.Database): void {
|
||||
-- causing a history scan for every queued command on Node's main thread.
|
||||
CREATE INDEX IF NOT EXISTS ec_host_operations_kind ON ec_host_operations(host_id, kind, created_at);
|
||||
CREATE INDEX IF NOT EXISTS ec_host_operations_kind_state ON ec_host_operations(kind, state);
|
||||
CREATE INDEX IF NOT EXISTS ec_host_operations_active ON ec_host_operations(state, id)
|
||||
WHERE state IN ('pending','accepted','running','unknown');
|
||||
CREATE TABLE IF NOT EXISTS ec_host_operation_payloads (
|
||||
operation_id TEXT PRIMARY KEY REFERENCES ec_host_operations(id) ON DELETE CASCADE,
|
||||
payload TEXT NOT NULL
|
||||
|
||||
Reference in New Issue
Block a user