explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RUok : SFT_EE_R_WORKER_NONCATEGORY_MOD_01

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 993.877 ↑ 1.0 1 1

Limit (cost=51,329.25..51,329.26 rows=1 width=73) (actual time=993.876..993.877 rows=1 loops=1)

2. 0.020 993.873 ↑ 1.0 1 1

Sort (cost=51,329.25..51,329.26 rows=1 width=73) (actual time=993.873..993.873 rows=1 loops=1)

  • Sort Key: feew.ee_payslip_id DESC
  • Sort Method: quicksort Memory: 25kB
3. 0.023 993.853 ↑ 1.0 1 1

WindowAgg (cost=1.84..51,329.24 rows=1 width=73) (actual time=993.850..993.853 rows=1 loops=1)

4. 0.013 993.830 ↑ 1.0 1 1

Nested Loop (cost=1.84..51,329.23 rows=1 width=61) (actual time=332.085..993.830 rows=1 loops=1)

  • Join Filter: (feep.ee_pscheme_id = ferp.pscheme_id)
  • Rows Removed by Join Filter: 1
5. 2.651 2.651 ↓ 2.0 2 1

Seq Scan on ft_er_pschemes ferp (cost=0.00..388.85 rows=1 width=8) (actual time=1.640..2.651 rows=2 loops=1)

  • Filter: ((er_id = 23090) AND ((scheme_type)::text = 'WPP'::text))
  • Rows Removed by Filter: 8316
6. 3.806 991.166 ↑ 1.0 1 2

Nested Loop (cost=1.84..50,940.37 rows=1 width=69) (actual time=293.508..495.583 rows=1 loops=2)

  • Join Filter: ((feep.ee_id = feew.ee_id) AND (feep.ee_payslip_id = feew.ee_payslip_id))
7. 21.256 401.736 ↓ 5,631.0 5,631 2

Nested Loop (cost=1.41..7,268.20 rows=1 width=67) (actual time=3.460..200.868 rows=5,631 loops=2)

  • Join Filter: (fee.ee_id = feep.ee_id)
8. 48.416 228.512 ↓ 593.6 18,996 2

Nested Loop (cost=0.98..7,065.96 rows=32 width=55) (actual time=0.073..114.256 rows=18,996 loops=2)

9. 11.202 11.202 ↓ 1.5 853 2

Index Scan using ft_ee_u1 on ft_employees fee (cost=0.42..2,336.87 rows=551 width=43) (actual time=0.040..5.601 rows=853 loops=2)

  • Index Cond: (ee_er_id = 23090)
  • Filter: ((ee_sys_status)::text <> 'D'::text)
  • Rows Removed by Filter: 5
10. 168.894 168.894 ↓ 22.0 22 1,706

Index Scan using ft_enetvaly_u on ft_ee_net_values_ytd feenvy (cost=0.56..8.57 rows=1 width=16) (actual time=0.016..0.099 rows=22 loops=1,706)

  • Index Cond: ((ee_id = fee.ee_id) AND (ee_er_id = 23090))
11. 151.968 151.968 ↓ 0.0 0 37,992

Index Only Scan using ft_epschemey_p on ft_ee_pschemes_ytd feep (cost=0.43..6.31 rows=1 width=16) (actual time=0.004..0.004 rows=0 loops=37,992)

  • Index Cond: ((ee_payslip_id = feenvy.payslip_id) AND (ee_er_id = 23090) AND (ee_id = feenvy.ee_id))
  • Heap Fetches: 11262
12. 78.036 585.624 ↓ 0.0 0 11,262

Index Scan using ft_ee_wppy_p on ft_ee_wpp_ytd feew (cost=0.43..43,672.16 rows=1 width=26) (actual time=0.052..0.052 rows=0 loops=11,262)

  • Index Cond: ((ee_payslip_id = feenvy.payslip_id) AND (ee_id = feenvy.ee_id) AND (ee_er_id = 23090))
  • Filter: (((ej_flag)::text = 'N'::text) AND ((wor_flag)::text = 'N'::text) AND ((jh_flag)::text = 'N'::text) AND (ee_payslip_id = (SubPlan 1)))
  • Rows Removed by Filter: 1
13.          

SubPlan (forIndex Scan)

14. 0.180 507.588 ↑ 1.0 1 12

Aggregate (cost=43,665.87..43,665.88 rows=1 width=4) (actual time=42.299..42.299 rows=1 loops=12)

15. 507.408 507.408 ↓ 6.0 6 12

Index Only Scan using ft_ee_wppy_p on ft_ee_wpp_ytd feew2 (cost=0.43..43,665.87 rows=1 width=4) (actual time=40.761..42.284 rows=6 loops=12)

  • Index Cond: ((ee_id = feew.ee_id) AND (ee_er_id = feew.ee_er_id))
  • Heap Fetches: 72
Planning time : 5.008 ms
Execution time : 994.253 ms