explain.depesz.com

PostgreSQL's explain analyze made readable

Result: i6z

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1.493 58,830.974 ↓ 643.0 643 1

Nested Loop (cost=5,623.37..5,661.00 rows=1 width=18) (actual time=1,392.671..58,830.974 rows=643 loops=1)

2. 13.062 58,821.096 ↓ 645.0 645 1

Nested Loop (cost=5,622.94..5,655.10 rows=1 width=18) (actual time=1,392.545..58,821.096 rows=645 loops=1)

3. 0.621 625.189 ↓ 95.0 95 1

HashAggregate (cost=999.21..999.22 rows=1 width=4) (actual time=624.811..625.189 rows=95 loops=1)

  • Group Key: u0_1.dict_root_id
4. 0.440 624.568 ↓ 95.0 95 1

Hash Join (cost=399.02..999.21 rows=1 width=4) (actual time=168.111..624.568 rows=95 loops=1)

  • Hash Cond: (u0_1.id = u1.uniteddict_id)
5. 493.112 555.119 ↓ 1.2 186 1

Bitmap Heap Scan on slr_united_dict u0_1 (cost=5.65..605.43 rows=158 width=8) (actual time=66.975..555.119 rows=186 loops=1)

  • Recheck Cond: (ent_id = 4727)
  • Heap Blocks: exact=115
6. 62.007 62.007 ↓ 1.2 186 1

Bitmap Index Scan on slr_united__ent_id_5d708b_idx (cost=0.00..5.61 rows=158 width=0) (actual time=62.007..62.007 rows=186 loops=1)

  • Index Cond: (ent_id = 4727)
7. 0.068 69.009 ↑ 1.3 95 1

Hash (cost=391.86..391.86 rows=120 width=4) (actual time=69.008..69.009 rows=95 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
8. 44.064 68.941 ↑ 1.3 95 1

Bitmap Heap Scan on slr_report_settings_fzp_united_dicts u1 (cost=5.35..391.86 rows=120 width=4) (actual time=29.587..68.941 rows=95 loops=1)

  • Recheck Cond: (reportsettings_id = 5178)
  • Heap Blocks: exact=5
9. 24.877 24.877 ↑ 1.3 95 1

Bitmap Index Scan on slr_report_settings_fzp_united_dicts_reportsettings_id (cost=0.00..5.32 rows=120 width=0) (actual time=24.877..24.877 rows=95 loops=1)

  • Index Cond: (reportsettings_id = 5178)
10. 54,059.560 58,182.845 ↓ 7.0 7 95

Bitmap Heap Scan on slr_in_out_charges (cost=4,623.73..4,655.86 rows=1 width=18) (actual time=253.997..612.451 rows=7 loops=95)

  • Recheck Cond: ((local_dict_root_id = u0_1.dict_root_id) AND (ent_id = 4727))
  • Rows Removed by Index Recheck: 5454
  • Filter: ((NOT is_death_charge) AND (NOT no_show_charge) AND (period_date >= '2020-01-01'::date) AND (period_date <= '2020-01-31'::date) AND (type = ANY ('{1,7}'::integer[])))
  • Rows Removed by Filter: 1798
  • Heap Blocks: exact=56936 lossy=8731
11. 107.290 4,123.285 ↓ 0.0 0 95

BitmapAnd (cost=4,623.73..4,623.73 rows=8 width=0) (actual time=43.403..43.403 rows=0 loops=95)

12. 2,140.635 2,140.635 ↓ 8.9 45,794 95

Bitmap Index Scan on slr_in_out_charges_local_dict_root_id (cost=0.00..99.04 rows=5,150 width=0) (actual time=22.533..22.533 rows=45,794 loops=95)

  • Index Cond: (local_dict_root_id = u0_1.dict_root_id)
13. 1,875.360 1,875.360 ↓ 1.0 237,434 80

Bitmap Index Scan on slr_in_out_charges_dict_root_ent_id (cost=0.00..4,523.22 rows=234,487 width=0) (actual time=23.442..23.442 rows=237,434 loops=80)

  • Index Cond: (ent_id = 4727)
14. 8.385 8.385 ↑ 1.0 1 645

Index Scan using slr_employee_pkey on slr_employee u0 (cost=0.42..5.89 rows=1 width=4) (actual time=0.013..0.013 rows=1 loops=645)

  • Index Cond: (id = slr_in_out_charges.employee_id)
  • Filter: ((deleted_by_employee_id IS NULL) AND (admission_date <= '2020-01-31'::date) AND (lay_off_date >= '2020-01-01'::date) AND (ent_id = 4727) AND (job_type = ANY ('{1,2,3,4,5}'::integer[])))
  • Rows Removed by Filter: 0
Planning time : 189.838 ms
Execution time : 58,831.396 ms