explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3Muh

Settings
# exclusive inclusive rows x rows loops node
1. 0.386 51,825.378 ↑ 1,313.4 113 1

Sort (cost=885,166.78..885,537.83 rows=148,419 width=1,296) (actual time=51,825.37..51,825.378 rows=113 loops=1)

  • Sort Key: p.employeeid, tp.punchtime
  • Sort Method: quicksort Memory: 40kB
  • Buffers: shared hit=50,970
2. 0.167 51,824.992 ↑ 1,313.4 113 1

Hash Join (cost=16,847.44..788,712.1 rows=148,419 width=1,296) (actual time=9,329.635..51,824.992 rows=113 loops=1)

  • Buffers: shared hit=50,964
3. 51,281.248 51,281.248 ↑ 38.6 113 1

Seq Scan on wfm_timepunch tp (cost=0..761,586.16 rows=4,359 width=1,289) (actual time=8,785.978..51,281.248 rows=113 loops=1)

  • Filter: ((("current_user"())::text <> ANY ('{wfmadmin,skipvpd}'::text[])) AND vpd_sec_usr.f_sel_policy_all(tp.vpd_key, 'WFM_TIMEPUNCH'::character varying) AND (date_trunc('hour'::text, tp.punchtime) = '2020-06-01 04:00:00'::timestamp without time zone))
  • Buffers: shared hit=48,806
4. 0.064 543.577 ↑ 77.6 116 1

Hash (cost=16,734.94..16,734.94 rows=9,000 width=16) (actual time=543.577..543.577 rows=116 loops=1)

  • Buffers: shared hit=2,158
5. 0.148 543.513 ↑ 77.6 116 1

Hash Join (cost=7,691.44..16,734.94 rows=9,000 width=16) (actual time=248.663..543.513 rows=116 loops=1)

  • Buffers: shared hit=2,158
6. 301.352 301.352 ↑ 78.7 123 1

Seq Scan on chr_associate chr (cost=0..8,784.13 rows=9,678 width=8) (actual time=6.611..301.352 rows=123 loops=1)

  • Filter: ((("current_user"())::text <> ANY ('{wfmadmin,skipvpd}'::text[])) AND vpd_sec_usr.f_sel_policy_all_static(chr.vpd_key))
  • Buffers: shared hit=1,017
7. 0.069 242.013 ↑ 66.8 116 1

Hash (cost=7,594.54..7,594.54 rows=7,752 width=24) (actual time=242.013..242.013 rows=116 loops=1)

  • Buffers: shared hit=1,141
8. 241.944 241.944 ↑ 66.8 116 1

Seq Scan on chr_emp_position p (cost=0..7,594.54 rows=7,752 width=24) (actual time=73.892..241.944 rows=116 loops=1)

  • Filter: ((CURRENT_DATE >= p.eff_date) AND (CURRENT_DATE <= p.eff_date_end) AND (("current_user"())::text <> ANY ('{wfmadmin,skipvpd}'::text[])) AND vpd_sec_usr.f_sel_policy_all_static(p.vpd_key))
  • Buffers: shared hit=1,141
Planning time : 2.758 ms
Execution time : 51,825.497 ms