explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LD7y

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 17,360.505 ↓ 0.0 0 1

Limit (cost=0.43..50,297.16 rows=1 width=63) (actual time=17,360.505..17,360.505 rows=0 loops=1)

2. 0.001 17,360.504 ↓ 0.0 0 1

LockRows (cost=0.43..20,470,769.28 rows=407 width=63) (actual time=17,360.504..17,360.504 rows=0 loops=1)

3. 17,360.503 17,360.503 ↓ 0.0 0 1

Index Scan using jobs_priority_run_at_id_idx on jobs (cost=0.43..20,470,765.21 rows=407 width=63) (actual time=17,360.503..17,360.503 rows=0 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: 1632718
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.224 ms
Execution time : 17,360.551 ms