explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CySR

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 9,131.548 ↓ 0.0 0 1

Limit (cost=1,122.49..1,122.49 rows=1 width=10) (actual time=9,131.548..9,131.548 rows=0 loops=1)

2. 0.004 9,131.546 ↓ 0.0 0 1

Sort (cost=1,122.49..1,122.49 rows=1 width=10) (actual time=9,131.546..9,131.546 rows=0 loops=1)

  • Sort Key: cq.priority DESC, cq.id
  • Sort Method: quicksort Memory: 25kB
3. 0.010 9,131.542 ↓ 0.0 0 1

Nested Loop Anti Join (cost=1,088.75..1,122.48 rows=1 width=10) (actual time=9,131.542..9,131.542 rows=0 loops=1)

4. 3,760.841 9,131.492 ↑ 1.0 1 1

Nested Loop (cost=1,088.19..1,096.71 rows=1 width=25) (actual time=30.658..9,131.492 rows=1 loops=1)

  • Join Filter: (cq.id = (min(cq2.id)))
  • Rows Removed by Join Filter: 75453188
5. 19.361 19.361 ↓ 10,921.0 10,921 1

Index Scan using command_queue_status_idx on command_queue cq (cost=0.56..4.59 rows=1 width=25) (actual time=0.033..19.361 rows=10,921 loops=1)

  • Index Cond: ((status)::text = 'PENDING'::text)
6. 5,322.514 5,351.290 ↓ 34.5 6,909 10,921

HashAggregate (cost=1,087.62..1,089.62 rows=200 width=8) (actual time=0.003..0.490 rows=6,909 loops=10,921)

  • Group Key: min(cq2.id)
7. 6.720 28.776 ↓ 1.7 6,909 1

HashAggregate (cost=997.38..1,037.49 rows=4,011 width=23) (actual time=27.692..28.776 rows=6,909 loops=1)

  • Group Key: cq2.target_id
8. 22.056 22.056 ↓ 4.4 17,829 1

Index Scan using command_queue_status_idx on command_queue cq2 (cost=0.56..977.28 rows=4,019 width=23) (actual time=0.016..22.056 rows=17,829 loops=1)

  • Index Cond: ((status)::text = ANY ('{PENDING,ERROR}'::text[]))
9. 0.040 0.040 ↑ 1.0 1 1

Index Only Scan using command_queue_idx on command_queue cq3 (cost=0.56..13.17 rows=1 width=15) (actual time=0.040..0.040 rows=1 loops=1)

  • Index Cond: ((status = ANY ('{PROCESSING,ERROR}'::text[])) AND (to_recalculate = false) AND (target_id = (cq.target_id)::text))
  • Filter: (NOT to_recalculate)
  • Heap Fetches: 1
Planning time : 0.776 ms
Execution time : 9,131.622 ms