Query Performance
Median latency of every state-adapter query on PostgreSQL, SQLite, MySQL, MariaDB, Redis and the synchronous in-process adapter.
Every state-adapter method runs against the same seeded dataset on PostgreSQL, SQLite, MySQL, MariaDB, Redis and the synchronous in-process adapter.
Your stack
Showing every backend. Pick the ones you use to hide the rest on every benchmark page; the pick is saved in this browser.
Test setup
- MachineApple M1 Pro
- RuntimeNode.js v24
- InfrastructureDocker Desktop on macOSDatabases and pub/sub servers run in containers, so every round trip crosses the VM bridge.
- ServersPostgreSQL 18, SQLite 3.53, MySQL 26, MariaDB 13, Redis 8, NATS 2
- Runs10 per methodThe charts show the median (p50).
- DatasetScale 100A simulated week of traffic, generated once and loaded into every backend: all statuses, blocker topologies, multi-job chains, retries and deduplication keys.
- PostgreSQLpg driver, after ANALYZE
- SQLiteIn memory through better-sqlite3, after ANALYZE
- MySQLmysql2 driver, after ANALYZE TABLE1 GB InnoDB buffer pool: InnoDB reads with O_DIRECT, so it has no OS page cache to fall back on.
- MariaDBmysql2 driver, after ANALYZE TABLE1 GB InnoDB buffer pool.
- Redisioredis driver
- In-processSync in-process state adapterLoaded with the same dataset as the other backends.
Operational queries
The per-job path every worker and client call takes. The limit10 variants acquire or reclaim ten jobs in one statement, as the worker does when it fills or frees several idle slots at once.
Operational queries
- getChains/default
- PostgreSQL0.48
- SQLite0.06
- MySQL2.56
- MariaDB0.62
- Redis0.81
- In-process0.01
- getChains/lock
- PostgreSQL0.96
- SQLite0.05
- MySQL3.47
- MariaDB1.28
- Redis0.74
- In-process0.01
- getJobs/default
- PostgreSQL0.44
- SQLite0.03
- MySQL0.55
- MariaDB0.39
- Redis0.22
- In-process0.00
- getJobs/lock
- PostgreSQL1.04
- SQLite0.03
- MySQL1.71
- MariaDB0.89
- Redis0.39
- In-process0.00
- getWorkers/default
- PostgreSQL0.47
- SQLite0.02
- MySQL0.66
- MariaDB0.26
- Redis0.22
- In-process0.00
- getWorkers/lock
- PostgreSQL0.83
- SQLite0.03
- MySQL1.37
- MariaDB1.30
- Redis0.23
- In-process0.00
- createJobs/default
- PostgreSQL1.46
- SQLite0.07
- MySQL17.14
- MariaDB3.43
- Redis0.32
- In-process0.01
- createJobs/deduplication
- PostgreSQL0.75
- SQLite0.12
- MySQL1.18
- MariaDB1.51
- Redis0.65
- In-process0.01
- continueJobs/default
- PostgreSQL1.32
- SQLite0.10
- MySQL3.09
- MariaDB2.86
- Redis0.53
- In-process0.01
- addJobsBlockers/default
- PostgreSQL1.43
- SQLite0.09
- MySQL3.41
- MariaDB2.25
- Redis0.56
- In-process0.01
- getJobBlockers/default
- PostgreSQL0.35
- SQLite0.08
- MySQL0.56
- MariaDB0.31
- Redis0.57
- In-process0.00
- unblockJobs/default
- PostgreSQL2.47
- SQLite0.14
- MySQL1.97
- MariaDB1.74
- Redis0.56
- In-process0.01
- startWorker/default
- PostgreSQL0.67
- SQLite0.06
- MySQL2.00
- MariaDB1.88
- Redis0.49
- In-process0.00
- extendWorkerLease/default
- PostgreSQL0.96
- SQLite0.02
- MySQL2.57
- MariaDB2.26
- Redis0.32
- In-process0.00
- stopWorker/default
- PostgreSQL0.83
- SQLite0.02
- MySQL1.93
- MariaDB2.55
- Redis0.32
- In-process0.00
- startJobAttempts/default
- PostgreSQL2.58
- SQLite0.07
- MySQL3.05
- MariaDB4.07
- Redis0.21
- In-process0.00
- startJobAttempts/limit10
- PostgreSQL4.30
- SQLite0.18
- MySQL5.91
- MariaDB3.58
- Redis0.49
- In-process0.01
- completeJobs/default
- PostgreSQL2.35
- SQLite0.07
- MySQL2.58
- MariaDB2.92
- Redis0.43
- In-process0.01
- getStartAttemptDelayMs/default
- PostgreSQL1.47
- SQLite0.03
- MySQL1.07
- MariaDB1.18
- Redis0.38
- In-process0.00
- rescheduleJobs/default
- PostgreSQL0.94
- SQLite0.04
- MySQL2.75
- MariaDB2.51
- Redis0.37
- In-process0.00
- deleteChains/default
- PostgreSQL2.53
- SQLite0.08
- MySQL4.26
- MariaDB5.31
- Redis0.84
- In-process0.01
- deleteChains/multiJob
- PostgreSQL3.22
- SQLite0.09
- MySQL15.28
- MariaDB3.24
- Redis1.26
- In-process0.01
Listing queries
The list, filter and paginate path behind the dashboard, cleanup jobs and the query API. The blocked listing has its own partial index (job_blocked_idx) for its filter and scheduled-at ordering, so it lands in the same range as pending.
Type discovery & counts
- getChainTypeNames/default
- PostgreSQL0.74
- SQLite0.05
- MySQL0.53
- MariaDB0.43
- Redis0.28
- In-process0.01
- getJobTypeNames/default
- PostgreSQL0.69
- SQLite0.06
- MySQL0.41
- MariaDB0.61
- Redis0.26
- In-process0.02
- countChainsByTypeName/default
- PostgreSQL2.61
- SQLite1.41
- MySQL7.93
- MariaDB11.40
- Redis0.19
- In-process0.00
- countJobsByTypeName/default
- PostgreSQL2.80
- SQLite1.33
- MySQL8.45
- MariaDB12.51
- Redis0.20
- In-process0.00
- countWorkers/default
- PostgreSQL0.27
- SQLite0.01
- MySQL0.26
- MariaDB0.39
- Redis0.25
- In-process0.00
- countWorkersByTypeName/default
- PostgreSQL0.45
- SQLite0.04
- MySQL0.42
- MariaDB0.50
- Redis0.24
- In-process0.01
- countRunningJobsByWorkerId/default
- PostgreSQL0.33
- SQLite0.02
- MySQL0.31
- MariaDB0.38
- Redis0.19
- In-process0.00
List chains
- listChains/noStatus/default
- PostgreSQL0.77
- SQLite0.27
- MySQL1.05
- MariaDB0.91
- Redis0.82
- In-process0.02
- listChains/noStatus/independent
- PostgreSQL1.02
- SQLite0.33
- MySQL1.39
- MariaDB0.88
- Redis1.44
- In-process0.01
- listChains/noStatus/nonIndependent
- PostgreSQL145.73
- SQLite121.13
- MySQL219.43
- MariaDB223.56
- Redis74.26
- In-process0.00
- listChains/noStatus/fromTo
- PostgreSQL1.01
- SQLite0.27
- MySQL1.27
- MariaDB2.22
- Redis0.98
- In-process0.01
- listChains/noStatus/cursor
- PostgreSQL1.95
- SQLite0.57
- MySQL1.87
- MariaDB2.60
- Redis2.01
- In-process0.03
- listChains/running/default
- PostgreSQL1.02
- SQLite0.27
- MySQL1.32
- MariaDB1.44
- Redis0.83
- In-process0.01
- listChains/running/independent
- PostgreSQL1.09
- SQLite0.29
- MySQL1.44
- MariaDB1.60
- Redis1.56
- In-process0.01
- listChains/running/nonIndependent
- PostgreSQL24.26
- SQLite20.83
- MySQL100.78
- MariaDB128.02
- Redis68.60
- In-process0.00
- listChains/running/cursor
- PostgreSQL1.81
- SQLite0.52
- MySQL2.27
- MariaDB3.65
- Redis2.21
- In-process0.03
- listChains/completed/default
- PostgreSQL0.64
- SQLite0.29
- MySQL0.86
- MariaDB1.96
- Redis1.19
- In-process0.01
- listChains/completed/independent
- PostgreSQL1.20
- SQLite0.33
- MySQL1.38
- MariaDB1.83
- Redis1.98
- In-process0.01
- listChains/completed/nonIndependent
- PostgreSQL61.87
- SQLite50.10
- MySQL229.74
- MariaDB251.91
- Redis73.19
- In-process0.00
- listChains/completed/orderByCreatedAt
- PostgreSQL0.99
- SQLite0.61
- MySQL1.30
- MariaDB1.71
- Redis0.95
- In-process0.01
- listChains/completed/orderByCompletedAt
- PostgreSQL0.76
- SQLite0.30
- MySQL1.20
- MariaDB1.71
- Redis1.05
- In-process0.01
- listChains/completed/cursor
- PostgreSQL1.35
- SQLite0.74
- MySQL2.43
- MariaDB2.92
- Redis2.09
- In-process0.03
- listChains/completed/orderByCreatedAtCursor
- PostgreSQL1.25
- SQLite0.60
- MySQL2.33
- MariaDB2.99
- Redis2.03
- In-process0.02
- listChains/completed/orderByCompletedAtCursor
- PostgreSQL1.21
- SQLite0.52
- MySQL2.00
- MariaDB3.06
- Redis1.77
- In-process0.03
List jobs
- listJobs/noStatus/default
- PostgreSQL0.79
- SQLite0.27
- MySQL1.31
- MariaDB1.03
- Redis0.79
- In-process0.02
- listJobs/noStatus/fromTo
- PostgreSQL0.85
- SQLite0.25
- MySQL0.89
- MariaDB0.64
- Redis0.79
- In-process0.02
- listJobs/noStatus/cursor
- PostgreSQL1.92
- SQLite0.41
- MySQL1.60
- MariaDB1.14
- Redis1.85
- In-process0.04
- listJobs/pending/default
- PostgreSQL1.27
- SQLite0.20
- MySQL0.62
- MariaDB0.87
- Redis0.83
- In-process0.01
- listJobs/pending/fromTo
- PostgreSQL0.78
- SQLite0.22
- MySQL0.49
- MariaDB0.95
- Redis0.65
- In-process0.01
- listJobs/pending/orderByCreatedAt
- PostgreSQL0.78
- SQLite0.20
- MySQL0.52
- MariaDB1.11
- Redis0.56
- In-process0.02
- listJobs/pending/cursor
- PostgreSQL1.30
- SQLite0.41
- MySQL0.89
- MariaDB1.68
- Redis1.17
- In-process0.03
- listJobs/blocked/default
- PostgreSQL1.10
- SQLite0.23
- MySQL0.47
- MariaDB0.70
- Redis0.60
- In-process0.01
- listJobs/blocked/fromTo
- PostgreSQL1.11
- SQLite0.22
- MySQL0.48
- MariaDB0.72
- Redis0.56
- In-process0.01
- listJobs/blocked/orderByCreatedAt
- PostgreSQL1.08
- SQLite0.22
- MySQL0.54
- MariaDB0.82
- Redis0.56
- In-process0.01
- listJobs/blocked/cursor
- PostgreSQL1.93
- SQLite0.40
- MySQL0.94
- MariaDB1.00
- Redis1.16
- In-process0.03
- listJobs/running/default
- PostgreSQL1.36
- SQLite0.32
- MySQL0.48
- MariaDB0.52
- Redis0.61
- In-process0.02
- listJobs/running/orderByCreatedAt
- PostgreSQL0.77
- SQLite0.21
- MySQL0.53
- MariaDB0.96
- Redis0.56
- In-process0.01
- listJobs/running/cursor
- PostgreSQL11.11
- SQLite0.60
- MySQL0.93
- MariaDB1.43
- Redis1.18
- In-process0.03
- listJobs/completed/default
- PostgreSQL0.95
- SQLite0.26
- MySQL0.69
- MariaDB0.53
- Redis0.56
- In-process0.01
- listJobs/completed/orderByCreatedAt
- PostgreSQL1.02
- SQLite0.23
- MySQL1.07
- MariaDB0.59
- Redis0.54
- In-process0.01
- listJobs/completed/cursor
- PostgreSQL1.56
- SQLite0.46
- MySQL1.61
- MariaDB0.90
- Redis1.32
- In-process0.02
List chain jobs & blocked jobs
- listChainJobs/default
- PostgreSQL3.33
- SQLite0.91
- MySQL0.80
- MariaDB3.63
- Redis0.51
- In-process0.01
- listChainJobs/cursor
- PostgreSQL6.14
- SQLite1.93
- MySQL1.33
- MariaDB5.18
- Redis1.15
- In-process0.01
- listBlockedJobs/default
- PostgreSQL177.82
- SQLite225.34
- MySQL207.28
- MariaDB175.24
- Redis0.55
- In-process0.01
- listBlockedJobs/cursor
- PostgreSQL324.83
- SQLite438.39
- MySQL420.59
- MariaDB324.15
- Redis1.01
- In-process0.02
List workers & worker jobs
- listWorkers/default
- PostgreSQL0.74
- SQLite0.10
- MySQL0.58
- MariaDB0.40
- Redis0.45
- In-process0.03
- listWorkers/typeName
- PostgreSQL0.45
- SQLite0.07
- MySQL0.73
- MariaDB0.32
- Redis0.30
- In-process0.01
- listWorkers/status
- PostgreSQL0.28
- SQLite0.06
- MySQL0.37
- MariaDB0.28
- Redis1.74
- In-process0.00
- listWorkers/cursor
- PostgreSQL0.74
- SQLite0.17
- MySQL0.99
- MariaDB0.69
- Redis1.07
- In-process0.06
- listWorkerJobs/default
- PostgreSQL0.49
- SQLite0.15
- MySQL0.41
- MariaDB6.75
- Redis0.46
- In-process0.00
- listWorkerJobs/cursor
- PostgreSQL1.58
- SQLite0.27
- MySQL1.70
- MariaDB14.47
- Redis0.77
- In-process0.02
Reproduce
From benchmarks/query-performance, with Docker running for PostgreSQL, MySQL, MariaDB and Redis. Each run also writes the query plans to explanations/.
Terminal
pnpm --filter benchmark-query-performance start:postgres
pnpm --filter benchmark-query-performance start:sqlite
pnpm --filter benchmark-query-performance start:mysql
pnpm --filter benchmark-query-performance start:mariadb
pnpm --filter benchmark-query-performance start:redis
pnpm --filter benchmark-query-performance start:in-process