explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3l7w

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 51,931.795 ↑ 1.0 31 1

Limit (cost=2,880,385.80..2,880,385.88 rows=31 width=24) (actual time=51,931.787..51,931.795 rows=31 loops=1)

  • Buffers: shared hit=3658412 read=198
  • I/O Timings: read=7.765
2. 3.191 51,931.789 ↑ 6.0 31 1

Sort (cost=2,880,385.80..2,880,386.27 rows=187 width=24) (actual time=51,931.786..51,931.789 rows=31 loops=1)

  • Sort Key: pi.surname
  • Sort Method: top-N heapsort Memory: 27kB
  • Buffers: shared hit=3658412 read=198
  • I/O Timings: read=7.765
3. 4.695 51,928.598 ↓ 1.9 348 1

Nested Loop (cost=1.30..2,880,380.23 rows=187 width=24) (actual time=189.253..51,928.598 rows=348 loops=1)

  • Buffers: shared hit=3658412 read=198
  • I/O Timings: read=7.765
4. 1.038 29.099 ↓ 1.9 348 1

Nested Loop (cost=0.87..3,729.49 rows=187 width=12) (actual time=2.033..29.099 rows=348 loops=1)

  • Buffers: shared hit=4128
5. 0.955 24.581 ↓ 1.9 348 1

Nested Loop (cost=0.58..3,660.39 rows=187 width=12) (actual time=2.026..24.581 rows=348 loops=1)

  • Buffers: shared hit=3084
6. 2.529 19.798 ↓ 1.9 348 1

Nested Loop (cost=0.29..3,588.11 rows=187 width=16) (actual time=2.016..19.798 rows=348 loops=1)

  • Buffers: shared hit=2320
7. 11.353 11.353 ↓ 1.9 348 1

Seq Scan on bso_rec_record brrc (cost=0.00..2,380.74 rows=187 width=12) (actual time=1.995..11.353 rows=348 loops=1)

  • Filter: (clinic_id = 30)
  • Rows Removed by Filter: 88308
  • Buffers: shared hit=1276
8. 5.916 5.916 ↑ 1.0 1 348

Index Scan using pim_employee_position_pk on pim_employee_position pep (cost=0.29..6.45 rows=1 width=12) (actual time=0.015..0.017 rows=1 loops=348)

  • Index Cond: (id = brrc.receiver_id)
  • Buffers: shared hit=1044
9. 3.828 3.828 ↑ 1.0 1 348

Index Only Scan using pim_position_pk on pim_position pp (cost=0.29..0.38 rows=1 width=4) (actual time=0.009..0.011 rows=1 loops=348)

  • Index Cond: (id = pep.position_id)
  • Heap Fetches: 67
  • Buffers: shared hit=764
10. 3.480 3.480 ↑ 1.0 1 348

Index Scan using pim_employee_pk on pim_employee pe (cost=0.29..0.36 rows=1 width=8) (actual time=0.008..0.010 rows=1 loops=348)

  • Index Cond: (id = pep.employee_id)
  • Buffers: shared hit=1044
11. 4.872 4.872 ↑ 1.0 1 348

Index Scan using pim_individual_pk on pim_individual pi (cost=0.43..4.53 rows=1 width=20) (actual time=0.010..0.014 rows=1 loops=348)

  • Index Cond: (id = pe.individual_id)
  • Buffers: shared hit=1392
12.          

SubPlan (for Nested Loop)

13. 9.744 51,889.932 ↑ 1.0 1 348

Aggregate (cost=15,378.60..15,378.61 rows=1 width=0) (actual time=149.109..149.109 rows=1 loops=348)

  • Buffers: shared hit=3652892 read=198
  • I/O Timings: read=7.765
14. 37,805.676 51,880.188 ↑ 3.7 3 348

Hash Join (cost=11.31..15,378.57 rows=11 width=0) (actual time=104.103..149.081 rows=3 loops=348)

  • Hash Cond: (sd.range_id = brr.id)
  • Buffers: shared hit=3652892 read=198
  • I/O Timings: read=7.765
15. 14,057.460 14,057.460 ↓ 1.0 364,009 348

Seq Scan on sickdoc sd (cost=0.00..14,037.84 rows=354,484 width=4) (actual time=0.003..40.395 rows=364,009 loops=348)

  • Buffers: shared hit=3651564
16. 1.392 17.052 ↑ 3.7 3 348

Hash (cost=11.17..11.17 rows=11 width=4) (actual time=0.049..0.049 rows=3 loops=348)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=1328 read=198
  • I/O Timings: read=7.765
17. 15.660 15.660 ↑ 3.7 3 348

Index Scan using bso_record_range_rec_record_id_idx on bso_record_range brr (cost=0.42..11.17 rows=11 width=4) (actual time=0.043..0.045 rows=3 loops=348)

  • Index Cond: (rec_record_id = brrc.id)
  • Buffers: shared hit=1328 read=198
  • I/O Timings: read=7.765
Planning time : 1.657 ms
Execution time : 51,931.920 ms