explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ySQY

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 55,056.054 ↑ 1.0 1 1

Limit (cost=0.43..50,756.40 rows=1 width=63) (actual time=55,056.052..55,056.054 rows=1 loops=1)

2. 0.008 55,056.051 ↑ 287.0 1 1

LockRows (cost=0.43..14,566,964.79 rows=287 width=63) (actual time=55,056.051..55,056.051 rows=1 loops=1)

3. 55,056.043 55,056.043 ↑ 287.0 1 1

Index Scan using jobs_priority_run_at_id_idx on jobs (cost=0.43..14,566,961.92 rows=287 width=63) (actual time=55,056.043..55,056.043 rows=1 loops=1)

  • Index Cond: (run_at <= now())
  • Filter: ((task_identifier = ANY ('{card-state}'::text[])) AND (attempts < max_attempts) AND ((locked_at IS NULL) OR (locked_at < (now() - '04:00:00'::interval))) AND ((queue_name IS NULL) OR (SubPlan 1)))
  • Rows Removed by Filter: 1262670
4.          

SubPlan (for Index Scan)

5. 0.000 0.000 ↓ 0.0 0

LockRows (cost=0.55..8.59 rows=1 width=10) (never executed)

6. 0.000 0.000 ↓ 0.0 0

Index Scan using job_queues_pkey on job_queues (cost=0.55..8.58 rows=1 width=10) (never executed)

  • Index Cond: (queue_name = jobs.queue_name)
  • Filter: ((locked_at IS NULL) OR (locked_at < (now() - '04:00:00'::interval)))
Planning time : 0.258 ms
Execution time : 55,056.099 ms