explain.depesz.com

PostgreSQL's explain analyze made readable

Result: G6kF

Settings
# exclusive inclusive rows x rows loops node
1. 112.354 52,365.808 ↓ 29,363.0 29,363 1

Nested Loop (cost=2.79..49,826.26 rows=1 width=0) (actual time=110.948..52,365.808 rows=29,363 loops=1)

  • Join Filter: (item.status_id = status.id)
  • Rows Removed by Join Filter: 88,089
  • Buffers: shared hit=236,834 read=29,610
  • I/O Timings: read=51,180.858
2. 26.249 52,194.728 ↓ 29,363.0 29,363 1

Nested Loop (cost=2.79..49,825.17 rows=1 width=4) (actual time=110.926..52,194.728 rows=29,363 loops=1)

  • Output: item.status_id
  • Buffers: shared hit=207,471 read=29,610
  • I/O Timings: read=51,180.858
3. 56.745 52,021.664 ↓ 29,363.0 29,363 1

Nested Loop (cost=2.50..49,820.86 rows=1 width=8) (actual time=110.810..52,021.664 rows=29,363 loops=1)

  • Output: item.bill_id, item.status_id
  • Buffers: shared hit=119,381 read=29,610
  • I/O Timings: read=51,180.858
4. 77.553 41,100.609 ↓ 4,893.8 29,363 1

Merge Join (cost=2.07..49,771.71 rows=6 width=8) (actual time=83.695..41,100.609 rows=29,363 loops=1)

  • Output: s.srv_rendered_id, s.bill_id
  • Merge Cond: (s.case_id = c.case_id)
  • Buffers: shared hit=4,898 read=26,568
  • I/O Timings: read=40,698.846
5. 39,922.936 39,922.936 ↓ 2.2 29,363 1

Index Scan using fin_bill_steps_bill_id_case_id_idx on billing.fin_bill_steps s (cost=0.56..49,025.97 rows=13,143 width=12) (actual time=46.797..39,922.936 rows=29,363 loops=1)

  • Output: s.srv_rendered_id, s.bill_id, s.case_id
  • Index Cond: (s.bill_id = 6,287)
  • Buffers: shared hit=3,013 read=26,149
  • I/O Timings: read=39,620.047
6. 1,100.120 1,100.120 ↓ 3.1 29,363 1

Index Only Scan using fin_bill_cases_pk on billing.fin_bill_cases c (cost=0.44..689.58 rows=9,359 width=8) (actual time=36.871..1,100.120 rows=29,363 loops=1)

  • Output: c.bill_id, c.case_id
  • Index Cond: (c.bill_id = 6,287)
  • Heap Fetches: 212
  • Buffers: shared hit=1,885 read=419
  • I/O Timings: read=1,078.799
7. 10,864.310 10,864.310 ↑ 1.0 1 29,363

Index Scan using fin_bill_spec_item_service_id_idx on public.fin_bill_spec_item item (cost=0.44..8.18 rows=1 width=12) (actual time=0.369..0.370 rows=1 loops=29,363)

  • Output: item.id, item.price, item.tariff, item.bill_id, item.service_id, item.number, item.is_deleted, item.comment, item.doc_id, item.status_id, item.correctional_bill_id
  • Index Cond: (item.service_id = s.srv_rendered_id)
  • Filter: (item.bill_id = 6,287)
  • Buffers: shared hit=114,483 read=3,042
  • I/O Timings: read=10,482.012
8. 146.815 146.815 ↑ 1.0 1 29,363

Index Only Scan using fin_bill_pkey on public.fin_bill bill (cost=0.28..4.30 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=29,363)

  • Output: bill.id
  • Index Cond: (bill.id = 6,287)
  • Heap Fetches: 29,363
  • Buffers: shared hit=88,090
9. 58.726 58.726 ↑ 1.0 4 29,363

Seq Scan on public.fin_bill_payment_status status (cost=0.00..1.04 rows=4 width=4) (actual time=0.001..0.002 rows=4 loops=29,363)

  • Output: status.id, status.code, status.name, status.e_code, status.aud_who, status.aud_when, status.aud_source, status.aud_who_create, status.aud_when_create, status.aud_source_create
  • Buffers: shared hit=29,363
Planning time : 194.728 ms
Execution time : 52,373.330 ms