explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ynYm

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.001 44.726 ↓ 0.0 0 1

Merge Join (cost=28,631.01..47,912.56 rows=61,726 width=450) (actual time=44.726..44.726 rows=0 loops=1)

  • Buffers: shared hit=2,314
2.          

CTE data_p

3. 0.000 0.000 ↓ 0.0 0 0

Nested Loop (cost=25.94..14,667.29 rows=12,822 width=50) (never executed)

4. 0.000 0.000 ↓ 0.0 0 0

Nested Loop (cost=25.94..269.99 rows=324 width=7) (never executed)

5. 0.000 0.000 ↓ 0.0 0 0

Bitmap Heap Scan on chr_emp_position person (cost=4.31..16.66 rows=1 width=11) (never executed)

  • Filter: ((("current_user"())::text <> ANY ('{wfmadmin,skipvpd}'::text[])) AND vpd_sec_usr.f_sel_policy_all_static(person.vpd_key))
6. 0.000 0.000 ↓ 0.0 0 0

Bitmap Index Scan on chr_emp_position_idx15 (cost=0..4.31 rows=3 width=0) (never executed)

  • Index Cond: ((person.pfid)::text = '29449'::text)
7. 0.000 0.000 ↓ 0.0 0 0

Bitmap Heap Scan on pyr_pay_group c (cost=21.63..250.98 rows=235 width=16) (never executed)

  • Filter: ((("current_user"())::text <> ANY ('{wfmadmin,skipvpd}'::text[])) AND vpd_sec_usr.f_sel_policy_all_static(c.vpd_key))
8. 0.000 0.000 ↓ 0.0 0 0

Bitmap Index Scan on pyr_pay_group_idx2 (cost=0..21.57 rows=705 width=0) (never executed)

  • Index Cond: ((c.co_code)::text = (person.companycode)::text)
9. 0.000 0.000 ↓ 0.0 0 0

Index Scan using pyr_payroll_schedule_idx5 on pyr_payroll_schedule p_1 (cost=0..44.03 rows=41 width=50) (never executed)

  • Index Cond: ((p_1.payroll_cycle_oid)::text = (c.payroll_cycle_oid)::text)
  • Filter: ((("current_user"())::text <> ANY ('{wfmadmin,skipvpd}'::text[])) AND vpd_sec_usr.f_sel_policy_all(p_1.vpd_key, 'PYR_PAYROLL_SCHEDULE'::character varying) AND (p_1.f_unscheduled = '0'::numeric))
10.          

CTE data_q

11. 39.239 44.692 ↓ 0.0 0 1

Bitmap Heap Scan on pyr_payroll_schedule q_1 (cost=3,626.93..12,151.49 rows=8,025 width=15) (actual time=44.692..44.692 rows=0 loops=1)

  • Filter: ((("current_user"())::text <> ANY ('{wfmadmin,skipvpd}'::text[])) AND vpd_sec_usr.f_sel_policy_all(q_1.vpd_key, 'PYR_PAYROLL_SCHEDULE'::character varying) AND (q_1.f_unscheduled = '0'::numeric))
  • Heap Blocks: exact=1,613
  • Buffers: shared hit=2,309
12. 5.453 5.453 ↑ 8.9 2,692 1

Bitmap Index Scan on pyr_payroll_schedule_idx4 (cost=0..3,624.92 rows=24,077 width=0) (actual time=5.453..5.453 rows=2,692 loops=1)

  • Index Cond: ((CURRENT_DATE >= q_1.start_date) AND (CURRENT_DATE <= q_1.end_date))
  • Buffers: shared hit=617
13. 0.031 44.725 ↓ 0.0 0 1

Sort (cost=680.93..701 rows=8,025 width=90) (actual time=44.724..44.725 rows=0 loops=1)

  • Sort Key: q.payroll_cycle_oid
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=2,314
14. 44.694 44.694 ↓ 0.0 0 1

CTE Scan on data_q q (cost=0..160.5 rows=8,025 width=90) (actual time=44.694..44.694 rows=0 loops=1)

  • Buffers: shared hit=2,309
15. 0.000 0.000 ↓ 0.0 0 0

Sort (cost=1,131.31..1,163.36 rows=12,822 width=418) (never executed)

  • Sort Key: p.payrollcycleoid
16. 0.000 0.000 ↓ 0.0 0 0

CTE Scan on data_p p (cost=0..256.44 rows=12,822 width=418) (never executed)

Planning time : 2.063 ms
Execution time : 45.723 ms