explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xgx

Settings
# exclusive inclusive rows x rows loops node
1. 1.221 1.221 ↑ 6,557.1 119 1

CTE Scan on _resolution (cost=1,006,887.87..1,022,493.87 rows=780,300 width=16) (actual time=0.023..1.221 rows=119 loops=1)

  • Output: _resolution.document_id, _resolution.r_id
  • Buffers: shared hit=586
2.          

CTE _resolution

3. 0.125 1.137 ↑ 6,557.1 119 1

Recursive Union (cost=0.00..1,006,887.87 rows=780,300 width=48) (actual time=0.020..1.137 rows=119 loops=1)

  • Buffers: shared hit=586
4. 0.001 0.020 ↑ 1.0 10 1

Limit (cost=0.00..0.16 rows=10 width=18) (actual time=0.016..0.020 rows=10 loops=1)

  • Output: r.document_id, r.r_id, r.sub_deleted_str
  • Buffers: shared hit=1
5. 0.019 0.019 ↑ 19,313.4 10 1

Seq Scan on rem_pkg._temp_t5_hierarch_1 r (cost=0.00..3,162.34 rows=193,134 width=18) (actual time=0.015..0.019 rows=10 loops=1)

  • Output: r.document_id, r.r_id, r.sub_deleted_str
  • Buffers: shared hit=1
6. 0.143 0.992 ↑ 11,147.0 7 16

Nested Loop (cost=0.57..99,128.17 rows=78,029 width=48) (actual time=0.011..0.062 rows=7 loops=16)

  • Output: r_1.document_id, r_1.id, ((_r.sub_deleted_str || '+'::text) || (COALESCE((CASE WHEN (r_1.vzamen = r_1.parent_id) THEN 2 ELSE (r_1.has_vzamen)::integer END)::character varying, ''::character varying))::text)
  • Buffers: shared hit=585
7. 0.016 0.016 ↑ 14.3 7 16

WorkTable Scan on _resolution _r (cost=0.00..2.00 rows=100 width=40) (actual time=0.000..0.001 rows=7 loops=16)

  • Output: _r.document_id, _r.r_id, _r.sub_deleted_str
8. 0.833 0.833 ↑ 780.0 1 119

Index Scan using idx_resolution_parent_id on doc.resolution r_1 (cost=0.57..971.76 rows=780 width=34) (actual time=0.006..0.007 rows=1 loops=119)

  • Output: r_1.document_id, r_1.id, r_1.vzamen, r_1.parent_id, r_1.has_vzamen
  • Index Cond: (r_1.parent_id = _r.r_id)
  • Buffers: shared hit=585