explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gDl9

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 12,592.946 ↓ 2.0 2 1

Unique (cost=120,371.95..120,374.78 rows=1 width=4) (actual time=12,592.939..12,592.946 rows=2 loops=1)

2. 0.011 12,592.941 ↓ 4.0 4 1

Merge Join (cost=120,371.95..120,374.77 rows=1 width=4) (actual time=12,592.938..12,592.941 rows=4 loops=1)

  • Merge Cond: (slr_employee.id = slr_register_calcs.employee_id)
3. 0.016 0.144 ↑ 73.0 2 1

Sort (cost=14.54..14.91 rows=146 width=4) (actual time=0.143..0.144 rows=2 loops=1)

  • Sort Key: slr_employee.id
  • Sort Method: quicksort Memory: 25kB
4. 0.002 0.128 ↑ 73.0 2 1

Nested Loop (cost=5.34..9.29 rows=146 width=4) (actual time=0.127..0.128 rows=2 loops=1)

5. 0.006 0.096 ↑ 1.0 1 1

HashAggregate (cost=4.92..4.93 rows=1 width=4) (actual time=0.096..0.096 rows=1 loops=1)

  • Group Key: u0.candidate_id
6. 0.090 0.090 ↓ 2.0 2 1

Index Scan using slr_employee_pkey on slr_employee u0 (cost=0.42..4.92 rows=1 width=4) (actual time=0.080..0.090 rows=2 loops=1)

  • Index Cond: (id = ANY ('{574381,573106}'::integer[]))
  • Filter: ((deleted_by_employee_id IS NULL) AND (ent_id = 3394))
7. 0.030 0.030 ↑ 1.5 2 1

Index Scan using slr_employee_candidate_id on slr_employee (cost=0.42..4.34 rows=3 width=8) (actual time=0.029..0.030 rows=2 loops=1)

  • Index Cond: (candidate_id = u0.candidate_id)
8. 0.033 12,592.786 ↑ 20.9 20 1

Sort (cost=120,357.41..120,358.45 rows=417 width=4) (actual time=12,592.785..12,592.786 rows=20 loops=1)

  • Sort Key: slr_register_calcs.employee_id
  • Sort Method: quicksort Memory: 26kB
9. 6.127 12,592.753 ↑ 14.9 28 1

Nested Loop (cost=120,220.19..120,339.26 rows=417 width=4) (actual time=12,587.731..12,592.753 rows=28 loops=1)

  • -> Index Scan using slr_register_calcs_register_root_id on slr_register_calcs (cost=0.57..16.48 rows=60 width=8) (actual time=0.522..0.555 rows=3 loops=11)" Index Cond: (register_root_id = u0_1.register_root_id)
10. 0.086 12,586.626 ↓ 1.6 11 1

HashAggregate (cost=120,219.62..120,219.69 rows=7 width=8) (actual time=12,586.617..12,586.626 rows=11 loops=1)

  • Group Key: u0_1.register_root_id
11. 47.002 12,586.540 ↓ 1.6 11 1

Nested Loop (cost=5,752.37..120,219.60 rows=7 width=8) (actual time=1,460.297..12,586.540 rows=11 loops=1)

12. 101.793 167.976 ↑ 1.0 38,421 1

Bitmap Heap Scan on slr_payments_sheet u0_1 (cost=5,751.80..12,840.20 rows=38,853 width=4) (actual time=66.779..167.976 rows=38,421 loops=1)

  • Recheck Cond: (period_date = '2019-07-01'::date)
  • Filter: (state = 2)
  • Rows Removed by Filter: 524
  • Heap Blocks: exact=4210
13. 66.183 66.183 ↑ 1.0 38,945 1

Bitmap Index Scan on slr_payment_ent_id_44bb53_idx (cost=0.00..5,742.09 rows=39,360 width=0) (actual time=66.183..66.183 rows=38,945 loops=1)

  • Index Cond: (period_date = '2019-07-01'::date)
14. 12,371.562 12,371.562 ↓ 0.0 0 38,421

Index Scan using slr_register_root_pkey on slr_register_root u1 (cost=0.57..2.76 rows=1 width=4) (actual time=0.322..0.322 rows=0 loops=38,421)

  • Index Cond: (id = u0_1.register_root_id)
  • Filter: (ent_id = 3394)
  • Rows Removed by Filter: 1