explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Fwg6 : SFT_EE_R_WORKER_NONCATEGORY

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 943.195 ↑ 1.0 1 1

Limit (cost=51,322.14..51,322.15 rows=1 width=73) (actual time=943.194..943.195 rows=1 loops=1)

2. 0.018 943.192 ↑ 1.0 1 1

Sort (cost=51,322.14..51,322.15 rows=1 width=73) (actual time=943.192..943.192 rows=1 loops=1)

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

WindowAgg (cost=1.84..51,322.13 rows=1 width=73) (actual time=943.170..943.174 rows=1 loops=1)

4. 0.015 943.153 ↑ 1.0 1 1

Nested Loop (cost=1.84..51,322.12 rows=1 width=61) (actual time=292.377..943.153 rows=1 loops=1)

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

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

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

Nested Loop (cost=1.84..50,933.26 rows=1 width=69) (actual time=270.442..470.226 rows=1 loops=2)

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

Nested Loop (cost=1.41..7,268.21 rows=1 width=67) (actual time=3.098..194.993 rows=5,631 loops=2)

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

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

9. 11.634 11.634 ↓ 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.036..5.817 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.015..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. 69.096 540.576 ↓ 0.0 0 11,262

Index Scan using ft_ee_wppy_p on ft_ee_wpp_ytd feew (cost=0.43..43,665.04 rows=1 width=26) (actual time=0.048..0.048 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.216 471.480 ↑ 1.0 1 12

Aggregate (cost=43,658.75..43,658.76 rows=1 width=4) (actual time=39.289..39.290 rows=1 loops=12)

15. 471.264 471.264 ↓ 6.0 6 12

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

  • Index Cond: ((ee_id = feew.ee_id) AND (ee_er_id = feew.ee_er_id))
  • Heap Fetches: 72