explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FQsp : Optimization 1 for: plan #3eSd

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 18.649 33,106.160 ↑ 2.3 3,108 1

Nested Loop (cost=166.22..55,875.14 rows=7,084 width=1,326) (actual time=5,709.386..33,106.160 rows=3,108 loops=1)

2.          

CTE started

3. 13.343 13.343 ↓ 210.1 4,622 1

Index Scan using idx_entity_op_created on ticket (cost=0.56..46.78 rows=22 width=37) (actual time=0.053..13.343 rows=4,622 loops=1)

  • Index Cond: (((op_type)::text = 'SDD_SNAPSHOT'::text) AND ((entity_id)::text = 'sdb-services-test10:sdb17'::text))
4.          

CTE completed

5. 15.926 15.926 ↓ 219.8 4,615 1

Index Scan using idx_entity_op_created on ticket ticket_1 (cost=0.56..45.01 rows=21 width=37) (actual time=0.059..15.926 rows=4,615 loops=1)

  • Index Cond: (((op_type)::text = 'SDD_COPY_EXTENT_COMPLETE'::text) AND ((entity_id)::text = 'sdb-services-test10:sdb17'::text))
  • Filter: ((status)::text = ANY ('{COMPLETED,ABORT}'::text[]))
6. 10.343 26.345 ↓ 210.1 4,622 1

HashAggregate (cost=0.49..0.71 rows=22 width=516) (actual time=18.850..26.345 rows=4,622 loops=1)

  • Group Key: (started.job_id)::text
7. 16.002 16.002 ↓ 210.1 4,622 1

CTE Scan on started (cost=0.00..0.44 rows=22 width=516) (actual time=0.057..16.002 rows=4,622 loops=1)

8. 3,471.474 33,061.166 ↑ 322.0 1 4,622

Bitmap Heap Scan on ticket t (cost=73.94..2,532.35 rows=322 width=1,326) (actual time=7.153..7.153 rows=1 loops=4,622)

  • Recheck Cond: ((job_id)::text = (started.job_id)::text)
  • Filter: (NOT (hashed SubPlan 3))
  • Rows Removed by Filter: 461
  • Heap Blocks: exact=311533
9. 29,571.556 29,571.556 ↑ 1.4 465 4,622

Bitmap Index Scan on idx_job_op (cost=0.00..73.39 rows=644 width=0) (actual time=6.398..6.398 rows=465 loops=4,622)

  • Index Cond: ((job_id)::text = (started.job_id)::text)
10.          

SubPlan (for Bitmap Heap Scan)

11. 18.136 18.136 ↓ 219.8 4,615 1

CTE Scan on completed (cost=0.00..0.42 rows=21 width=516) (actual time=0.061..18.136 rows=4,615 loops=1)

Planning time : 0.455 ms
Execution time : 33,106.567 ms