explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sKNwh

Settings
# exclusive inclusive rows x rows loops node
1. 34.876 1,640.443 ↓ 3.0 8,424 1

Sort (cost=32,048.52..32,055.44 rows=2,768 width=2,281) (actual time=1,639.802..1,640.443 rows=8,424 loops=1)

  • Sort Key: orders.status, orders.order_key
  • Sort Method: quicksort Memory: 5505kB
  • Buffers: shared hit=126713
2. 1,142.560 1,605.567 ↓ 3.0 8,424 1

Hash Join (cost=305.36..31,890.27 rows=2,768 width=2,281) (actual time=37.004..1,605.567 rows=8,424 loops=1)

  • Hash Cond: ((orders.examination)::text = (examcd.code)::text)
  • Buffers: shared hit=126710
3. 31.239 325.189 ↓ 3.1 8,470 1

Nested Loop (cost=79.85..18,599.80 rows=2,768 width=2,281) (actual time=29.937..325.189 rows=8,470 loops=1)

  • Buffers: shared hit=60457
4. 133.502 158.430 ↓ 3.1 8,470 1

Bitmap Heap Scan on orders (cost=79.42..6,398.68 rows=2,768 width=1,861) (actual time=29.889..158.430 rows=8,470 loops=1)

  • Recheck Cond: (((site)::text = 'RM202'::text) AND (status < 40) AND (status > 10))
  • Filter: (cancel_reason IS NULL)
  • Rows Removed by Filter: 3
  • Heap Blocks: exact=24649
  • Buffers: shared hit=26527
5. 24.928 24.928 ↓ 9.2 29,703 1

Bitmap Index Scan on orders_idx06 (cost=0.00..78.72 rows=3,213 width=0) (actual time=24.928..24.928 rows=29,703 loops=1)

  • Index Cond: (((site)::text = 'RM202'::text) AND (status < 40) AND (status > 10))
  • Buffers: shared hit=1878
6. 135.520 135.520 ↑ 1.0 1 8,470

Index Scan using his_pkey on his (cost=0.43..4.40 rows=1 width=420) (actual time=0.015..0.016 rows=1 loops=8,470)

  • Index Cond: (paslink_key = orders.paslink_key)
  • Buffers: shared hit=33930
7. 1.434 3.034 ↑ 1.0 5,791 1

Hash (cost=153.12..153.12 rows=5,791 width=6) (actual time=3.034..3.034 rows=5,791 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 219kB
  • Buffers: shared hit=243
8. 1.600 1.600 ↑ 1.0 5,791 1

Index Only Scan using examcd_pkey on examcd (cost=0.28..153.12 rows=5,791 width=6) (actual time=0.067..1.600 rows=5,791 loops=1)

  • Heap Fetches: 534
  • Buffers: shared hit=243
9.          

SubPlan (forHash Join)

10. 134.784 134.784 ↑ 1.0 1 8,424

Index Scan using patient_pkey on patient (cost=0.43..4.45 rows=1 width=4) (actual time=0.016..0.016 rows=1 loops=8,424)

  • Index Cond: (his.computer_number = computer_number)
  • Buffers: shared hit=32058
Planning time : 6.445 ms
Execution time : 1,642.160 ms