explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BOHZ : argo_1

Settings
# exclusive inclusive rows x rows loops node
1. 1.224 1,872,264.179 ↓ 378.0 378 1

Sort (cost=188,990.35..188,990.35 rows=1 width=190) (actual time=1,872,264.090..1,872,264.179 rows=378 loops=1)

  • Sort Key: dmv_timesheetday_facts5.entrydate4, dmv_timesheetday_facts5.entrydate5, ((ui.lastname)::character varying(50)) COLLATE "en_US", ((ui.firstname)::character varying(50)) COLLATE "en_US", dmv_timesheetday_facts5.userduplicatename6, ((login.loginna (...)
  • Sort Method: quicksort Memory: 136kB
  • Buffers: shared hit=520880903 read=54231 written=45
2.          

CTE dmv_timesheetday_facts0cte

3. 5.280 1,872,202.265 ↓ 378.0 378 1

HashAggregate (cost=188,981.47..188,981.49 rows=1 width=65) (actual time=1,872,201.957..1,872,202.265 rows=378 loops=1)

  • Group Key: ts.userid, (date_part('month'::text, (at.entrydate)::timestamp without time zone))::integer, (date_part('year'::text, (at.entrydate)::timestamp without time zone))::integer, ui_1.duplicatename, at.projectid, at.taskid
  • Buffers: shared hit=520874966 read=54109 written=45
4. 801.761 1,872,196.985 ↓ 1,928.0 1,928 1

Nested Loop (cost=11.04..188,981.45 rows=1 width=65) (actual time=32,504.703..1,872,196.985 rows=1,928 loops=1)

  • Join Filter: (ts.userid = ui_1.id)
  • Rows Removed by Join Filter: 2969120
  • Buffers: shared hit=520874966 read=54109 written=45
5. 34,267.686 1,870,631.736 ↓ 1,928.0 1,928 1

Nested Loop (cost=11.04..188,910.80 rows=1 width=64) (actual time=32,500.632..1,870,631.736 rows=1,928 loops=1)

  • Join Filter: (ts.id = at.timesheetid)
  • Rows Removed by Join Filter: 92659004
  • Buffers: shared hit=520805591 read=54076 written=45
6. 409.416 410.266 ↓ 1,939.0 1,939 1

Index Scan using uix2tsuseridstartdate on timesheet ts (cost=9.06..2,997.68 rows=1 width=20) (actual time=1.348..410.266 rows=1,939 loops=1)

  • Index Cond: ((startdate >= '2018-12-31'::date) AND (startdate <= '2019-02-28'::date))
  • Filter: ((enddate >= '2018-12-31'::date) AND (enddate <= '2019-02-28'::date) AND ((hashed SubPlan 1) OR (NOT (hashed SubPlan 2))))
  • Rows Removed by Filter: 214
  • Buffers: shared hit=2012 read=1135 written=45
7.          

SubPlan (forIndex Scan)

8. 0.717 0.717 ↑ 1.2 77 1

Seq Scan on userlocation userlocation3 (cost=0.00..4.21 rows=94 width=4) (actual time=0.486..0.717 rows=77 loops=1)

  • Filter: ((startdate <= '2019-03-07'::date) AND (enddate >= '2019-03-07'::date) AND (locationid = ANY ('{f0d8ac56-1371-4061-8e22-744561a7ee5f,ffddc00f-4b78-440f-a46d-f5471d7c5a7c}'::uuid[])))
  • Rows Removed by Filter: 50
  • Buffers: shared read=2
9. 0.133 0.133 ↓ 1.0 127 1

Seq Scan on userlocation userlocation4 (cost=0.00..3.89 rows=126 width=4) (actual time=0.021..0.133 rows=127 loops=1)

  • Filter: ((startdate <= '2019-03-07'::date) AND (enddate >= '2019-03-07'::date))
  • Buffers: shared hit=2
10. 484,812.048 1,835,953.784 ↓ 1.0 47,788 1,939

Nested Loop Left Join (cost=1.97..184,855.92 rows=46,987 width=97) (actual time=0.037..946.856 rows=47,788 loops=1,939)

  • Join Filter: ((at.entrydate >= pc.effectivedate) AND (at.entrydate <= pc.enddate) AND (pj_1.id = at.projectid))
  • Buffers: shared hit=520803579 read=52941
11. 100,033.010 1,258,480.804 ↓ 1.0 47,788 1,939

Nested Loop Left Join (cost=1.42..159,360.87 rows=46,987 width=65) (actual time=0.027..649.036 rows=47,788 loops=1,939)

  • Join Filter: ((at.entrydate >= pc_1.effectivedate) AND (at.entrydate <= pc_1.enddate) AND (pj_2.id = at.projectid) AND (pc_1.clientid = at.userspecifiedclientid))
  • Buffers: shared hit=520803558 read=52939
12. 148,736.812 1,158,447.794 ↓ 1.0 47,788 1,939

Nested Loop Left Join (cost=0.86..158,300.06 rows=46,987 width=69) (actual time=0.024..597.446 rows=47,788 loops=1,939)

  • Buffers: shared hit=520803558 read=52933
13. 83,101.662 83,101.662 ↓ 1.0 47,788 1,939

Index Scan using ixata2projectid on dm_attendancetimeallocation_facts at (cost=0.43..18,700.90 rows=46,987 width=84) (actual time=0.016..42.858 rows=47,788 loops=1,939)

  • Index Cond: (projectid = 839)
  • Buffers: shared hit=70147232 read=10038
14. 926,609.320 926,609.320 ↑ 1.0 1 92,660,932

Index Scan using ixatamfactid on dm_attendancetimeallocation_metadata isbillable (cost=0.43..2.96 rows=1 width=17) (actual time=0.005..0.010 rows=1 loops=92,660,932)

  • Index Cond: (factid = at.id)
  • Filter: (upper(key) = 'URN:REPLICON:TIME-ENTRY-METADATA-KEY:IS-BILLABLE'::text)
  • Rows Removed by Filter: 3
  • Buffers: shared hit=450656326 read=42895
15. 0.000 0.000 ↓ 0.0 0 92,660,932

Materialize (cost=0.56..3.61 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=92,660,932)

  • Buffers: shared read=6
16. 0.002 2.894 ↓ 0.0 0 1

Nested Loop (cost=0.56..3.60 rows=1 width=16) (actual time=2.894..2.894 rows=0 loops=1)

  • Buffers: shared read=6
17. 1.542 1.542 ↑ 1.0 1 1

Index Only Scan using uix4pc_projectclienteffectiveend on projectclient pc_1 (cost=0.28..1.30 rows=1 width=16) (actual time=1.541..1.542 rows=1 loops=1)

  • Index Cond: (projectid = 839)
  • Heap Fetches: 0
  • Buffers: shared read=3
18. 1.350 1.350 ↓ 0.0 0 1

Index Scan using project_pkey on project pj_2 (cost=0.28..2.30 rows=1 width=4) (actual time=1.350..1.350 rows=0 loops=1)

  • Index Cond: (id = 839)
  • Filter: (clientbillingallocationmethod = 1)
  • Rows Removed by Filter: 1
  • Buffers: shared read=3
19. 92,660.242 92,660.932 ↑ 1.0 1 92,660,932

Materialize (cost=0.56..4.61 rows=1 width=44) (actual time=0.000..0.001 rows=1 loops=92,660,932)

  • Buffers: shared hit=5 read=1
20. 0.003 0.690 ↑ 1.0 1 1

Nested Loop (cost=0.56..4.60 rows=1 width=44) (actual time=0.688..0.690 rows=1 loops=1)

  • Buffers: shared hit=5 read=1
21. 0.006 0.006 ↑ 1.0 1 1

Index Scan using project_pkey on project pj_1 (cost=0.28..2.30 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (id = 839)
  • Filter: (clientbillingallocationmethod = 0)
  • Buffers: shared hit=3
22. 0.681 0.681 ↑ 1.0 1 1

Index Scan using uix4pc_projectclienteffectiveend on projectclient pc (cost=0.28..2.29 rows=1 width=44) (actual time=0.680..0.681 rows=1 loops=1)

  • Index Cond: (projectid = 839)
  • Buffers: shared hit=2 read=1
23. 763.488 763.488 ↓ 1.0 1,541 1,928

Seq Scan on userinfo ui_1 (cost=0.00..51.39 rows=1,539 width=5) (actual time=0.002..0.396 rows=1,541 loops=1,928)

  • Buffers: shared hit=69375 read=33
24.          

Initplan (forSort)

25. 0.531 0.531 ↑ 1.0 1 1

Seq Scan on systeminformation (cost=0.00..1.01 rows=1 width=4) (actual time=0.530..0.531 rows=1 loops=1)

  • Buffers: shared read=1
26. 0.628 1,872,262.424 ↓ 378.0 378 1

Nested Loop Left Join (cost=1.56..7.83 rows=1 width=190) (actual time=1,872,204.995..1,872,262.424 rows=378 loops=1)

  • Buffers: shared hit=520880888 read=54231 written=45
27. 1.122 1,872,211.144 ↓ 378.0 378 1

Nested Loop Left Join (cost=1.27..7.46 rows=1 width=124) (actual time=1,872,202.660..1,872,211.144 rows=378 loops=1)

  • Buffers: shared hit=520879840 read=54134 written=45
28. 0.369 1,872,209.644 ↓ 378.0 378 1

Nested Loop Left Join (cost=1.12..7.28 rows=1 width=128) (actual time=1,872,202.087..1,872,209.644 rows=378 loops=1)

  • Buffers: shared hit=520879578 read=54133 written=45
29. 0.303 1,872,207.763 ↓ 378.0 378 1

Nested Loop Left Join (cost=0.83..4.96 rows=1 width=124) (actual time=1,872,202.060..1,872,207.763 rows=378 loops=1)

  • Buffers: shared hit=520878444 read=54133 written=45
30. 0.424 1,872,206.704 ↓ 378.0 378 1

Nested Loop (cost=0.56..2.65 rows=1 width=95) (actual time=1,872,202.037..1,872,206.704 rows=378 loops=1)

  • Join Filter: (dmv_timesheetday_facts5.userid3 = login.userid)
  • Buffers: shared hit=520877310 read=54133 written=45
31. 0.673 1,872,204.390 ↓ 378.0 378 1

Nested Loop (cost=0.28..2.32 rows=1 width=86) (actual time=1,872,201.990..1,872,204.390 rows=378 loops=1)

  • Buffers: shared hit=520876095 read=54114 written=45
32. 1,872,202.583 1,872,202.583 ↓ 378.0 378 1

CTE Scan on dmv_timesheetday_facts0cte dmv_timesheetday_facts5 (cost=0.00..0.02 rows=1 width=69) (actual time=1,872,201.962..1,872,202.583 rows=378 loops=1)

  • Buffers: shared hit=520874966 read=54109 written=45
33. 1.134 1.134 ↑ 1.0 1 378

Index Scan using userinfo_pkey on userinfo ui (cost=0.28..2.29 rows=1 width=17) (actual time=0.003..0.003 rows=1 loops=378)

  • Index Cond: (id = dmv_timesheetday_facts5.userid3)
  • Buffers: shared hit=1129 read=5
34. 1.890 1.890 ↑ 1.0 1 378

Index Scan using login_pkey on login (cost=0.28..0.32 rows=1 width=13) (actual time=0.004..0.005 rows=1 loops=378)

  • Index Cond: (userid = ui.id)
  • Buffers: shared hit=1215 read=19
35. 0.756 0.756 ↑ 1.0 1 378

Index Scan using project_pkey on project pj (cost=0.28..2.29 rows=1 width=33) (actual time=0.001..0.002 rows=1 loops=378)

  • Index Cond: (dmv_timesheetday_facts5.projectid7 = id)
  • Buffers: shared hit=1134
36. 1.512 1.512 ↑ 1.0 1 378

Index Scan using task_pkey on task tk (cost=0.29..2.31 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=378)

  • Index Cond: (dmv_timesheetday_facts5.taskid8 = id)
  • Buffers: shared hit=1134
37. 0.378 0.378 ↓ 0.0 0 378

Index Scan using uix3er_currencyideffectivedate on exchangerate (cost=0.14..0.18 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=378)

  • Index Cond: ((variablecurrencyid = $4) AND (tk.estimatedcostcurrencyid = fixedcurrencyid) AND (('now'::cstring)::date >= effectivedate))
  • Filter: (('now'::cstring)::date <= enddate)
  • Buffers: shared hit=262
38. 50.652 50.652 ↑ 1.0 1 378

Index Scan using taskdenormalizedhierarchy_pkey on taskdenormalizedhierarchy tdh (cost=0.29..0.36 rows=1 width=74) (actual time=0.131..0.134 rows=1 loops=378)

  • Index Cond: (tk.id = taskid)
  • Buffers: shared hit=1048 read=97
Planning time : 112.666 ms
Execution time : 1,872,268.238 ms