explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Jca8

Settings
# exclusive inclusive rows x rows loops node
1. 0.074 48.726 ↓ 11.0 11 1

Nested Loop Left Join (cost=423.62..2,550.51 rows=1 width=1,918) (actual time=5.007..48.726 rows=11 loops=1)

2. 0.010 48.124 ↓ 11.0 11 1

Nested Loop (cost=423.50..2,499.78 rows=1 width=1,727) (actual time=4.860..48.124 rows=11 loops=1)

3. 0.015 48.081 ↓ 11.0 11 1

Nested Loop (cost=423.37..2,499.62 rows=1 width=1,695) (actual time=4.846..48.081 rows=11 loops=1)

4. 0.010 48.033 ↓ 3.7 11 1

Nested Loop (cost=423.24..2,499.14 rows=3 width=1,667) (actual time=4.832..48.033 rows=11 loops=1)

5. 0.019 48.012 ↓ 3.7 11 1

Nested Loop Left Join (cost=423.09..2,498.61 rows=3 width=1,637) (actual time=4.830..48.012 rows=11 loops=1)

6. 0.012 47.982 ↓ 3.7 11 1

Nested Loop Left Join (cost=422.95..2,497.58 rows=3 width=1,391) (actual time=4.827..47.982 rows=11 loops=1)

7. 0.004 47.948 ↓ 3.7 11 1

Nested Loop Left Join (cost=422.80..2,497.06 rows=3 width=1,349) (actual time=4.823..47.948 rows=11 loops=1)

8. 0.024 47.911 ↓ 3.7 11 1

Nested Loop Left Join (cost=422.65..2,496.53 rows=3 width=1,319) (actual time=4.815..47.911 rows=11 loops=1)

9. 2.108 47.876 ↓ 3.7 11 1

Hash Join (cost=422.51..2,493.67 rows=3 width=1,257) (actual time=4.812..47.876 rows=11 loops=1)

  • Hash Cond: (note."VisitId" = "note.Visit"."Id")
10. 6.490 41.194 ↑ 1.0 24,627 1

Hash Left Join (cost=123.57..2,102.35 rows=24,627 width=1,186) (actual time=0.162..41.194 rows=24,627 loops=1)

  • Hash Cond: (note."Id" = "note.NoteCosign"."NoteId")
11. 5.443 34.701 ↑ 1.0 24,627 1

Hash Left Join (cost=61.89..1,937.72 rows=24,627 width=904) (actual time=0.142..34.701 rows=24,627 loops=1)

  • Hash Cond: (note."Id" = "note.NoteErroneous"."NoteId")
12. 14.202 29.178 ↑ 1.0 24,627 1

Hash Left Join (cost=58.71..1,841.84 rows=24,627 width=823) (actual time=0.044..29.178 rows=24,627 loops=1)

  • Hash Cond: (note."Id" = "note.NoteReturn"."NoteId")
13. 14.972 14.972 ↑ 1.0 24,627 1

Seq Scan on "Notes" note (cost=0.00..1,682.27 rows=24,627 width=703) (actual time=0.009..14.972 rows=24,627 loops=1)

14. 0.000 0.004 ↓ 0.0 0 1

Hash (cost=48.09..48.09 rows=850 width=120) (actual time=0.004..0.004 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
15. 0.000 0.004 ↓ 0.0 0 1

Hash Left Join (cost=14.42..48.09 rows=850 width=120) (actual time=0.004..0.004 rows=0 loops=1)

  • Hash Cond: ("note.NoteReturn"."ReasonId" = "note.NoteReturn.Reason"."Id")
16. 0.001 0.004 ↓ 0.0 0 1

Hash Left Join (cost=13.26..43.45 rows=850 width=82) (actual time=0.004..0.004 rows=0 loops=1)

  • Hash Cond: ("note.NoteReturn"."CreatedById" = "note.NoteReturn.CreatedByUser"."Id")
17. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on "NoteReturns" "note.NoteReturn" (cost=0.00..18.50 rows=850 width=52) (actual time=0.003..0.003 rows=0 loops=1)

18. 0.000 0.000 ↓ 0.0 0

Hash (cost=8.67..8.67 rows=367 width=34) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Seq Scan on "Users" "note.NoteReturn.CreatedByUser" (cost=0.00..8.67 rows=367 width=34) (never executed)

20. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.07..1.07 rows=7 width=42) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Seq Scan on "Reasons" "note.NoteReturn.Reason" (cost=0.00..1.07 rows=7 width=42) (never executed)

22. 0.016 0.080 ↑ 1.0 36 1

Hash (cost=2.72..2.72 rows=36 width=81) (actual time=0.080..0.080 rows=36 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
23. 0.025 0.064 ↑ 1.0 36 1

Hash Left Join (cost=1.16..2.72 rows=36 width=81) (actual time=0.048..0.064 rows=36 loops=1)

  • Hash Cond: ("note.NoteErroneous"."ReasonId" = "note.NoteErroneous.Reason"."Id")
24. 0.020 0.020 ↑ 1.0 36 1

Seq Scan on "NotesErroneous" "note.NoteErroneous" (cost=0.00..1.36 rows=36 width=52) (actual time=0.015..0.020 rows=36 loops=1)

25. 0.009 0.019 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=37) (actual time=0.019..0.019 rows=7 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
26. 0.010 0.010 ↑ 1.0 7 1

Seq Scan on "Reasons" "note.NoteErroneous.Reason" (cost=0.00..1.07 rows=7 width=37) (actual time=0.010..0.010 rows=7 loops=1)

27. 0.000 0.003 ↓ 0.0 0 1

Hash (cost=48.43..48.43 rows=1,060 width=282) (actual time=0.003..0.003 rows=0 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 16kB
28. 0.000 0.003 ↓ 0.0 0 1

Hash Left Join (cost=13.26..48.43 rows=1,060 width=282) (actual time=0.003..0.003 rows=0 loops=1)

  • Hash Cond: ("note.NoteCosign"."AssignedUserId" = "note.NoteCosign.Assigned"."Id")
29. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on "NoteCosigns" "note.NoteCosign" (cost=0.00..20.60 rows=1,060 width=32) (actual time=0.003..0.003 rows=0 loops=1)

30. 0.000 0.000 ↓ 0.0 0

Hash (cost=8.67..8.67 rows=367 width=250) (never executed)

31. 0.000 0.000 ↓ 0.0 0

Seq Scan on "Users" "note.NoteCosign.Assigned" (cost=0.00..8.67 rows=367 width=250) (never executed)

32. 0.006 4.574 ↑ 1.0 2 1

Hash (cost=298.91..298.91 rows=2 width=75) (actual time=4.574..4.574 rows=2 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
33. 0.006 4.568 ↑ 1.0 2 1

Nested Loop (cost=0.29..298.91 rows=2 width=75) (actual time=0.047..4.568 rows=2 loops=1)

34. 4.552 4.552 ↑ 1.0 1 1

Seq Scan on "Patients" "note.Visit.Patient" (cost=0.00..287.74 rows=1 width=18) (actual time=0.038..4.552 rows=1 loops=1)

  • Filter: (("PatientXRef" ~~ '1.%'::text) AND ("left"("PatientXRef", 2) = '1.'::text) AND ("right"("PatientXRef", 6) = '.43747'::text))
  • Rows Removed by Filter: 7,813
35. 0.010 0.010 ↑ 1.0 2 1

Index Scan using "IX_Visits_PatientId" on "Visits" "note.Visit" (cost=0.29..11.15 rows=2 width=61) (actual time=0.005..0.010 rows=2 loops=1)

  • Index Cond: ("PatientId" = "note.Visit.Patient"."Id")
36. 0.011 0.011 ↓ 0.0 0 11

Index Scan using "PK_Users" on "Users" "note.NoteErroneous.CreatedByUser" (cost=0.15..0.94 rows=1 width=66) (actual time=0.001..0.001 rows=0 loops=11)

  • Index Cond: ("note.NoteErroneous"."CreatedById" = "Id")
37. 0.033 0.033 ↑ 1.0 1 11

Index Scan using "PK_Users" on "Users" "note.Signer" (cost=0.15..0.17 rows=1 width=34) (actual time=0.002..0.003 rows=1 loops=11)

  • Index Cond: (note."SignerUserId" = "Id")
38. 0.022 0.022 ↑ 1.0 1 11

Index Scan using "PK_NoteTypes" on "NoteTypes" "note.NoteType" (cost=0.14..0.16 rows=1 width=46) (actual time=0.002..0.002 rows=1 loops=11)

  • Index Cond: (note."NoteTypeId" = "Id")
39. 0.011 0.011 ↑ 1.0 1 11

Index Scan using "PK_Users" on "Users" "note.NoteType.CreatedByUser" (cost=0.15..0.34 rows=1 width=250) (actual time=0.001..0.001 rows=1 loops=11)

  • Index Cond: ("note.NoteType"."CreatedById" = "Id")
40. 0.011 0.011 ↑ 1.0 1 11

Index Scan using "PK_Users" on "Users" "note.Author" (cost=0.15..0.17 rows=1 width=34) (actual time=0.001..0.001 rows=1 loops=11)

  • Index Cond: ("Id" = note."AuthorUserId")
41. 0.033 0.033 ↑ 1.0 1 11

Index Scan using "PK_Companies" on "Companies" "note.Company" (cost=0.13..0.15 rows=1 width=36) (actual time=0.003..0.003 rows=1 loops=11)

  • Index Cond: ("Id" = note."CompanyId")
  • Filter: ("CompanyXRef" = 'CompanyNotFound'::text)
42. 0.033 0.033 ↑ 1.0 1 11

Index Scan using "PK_PatientClasses" on "PatientClasses" "note.Visit.PatientClass" (cost=0.12..0.14 rows=1 width=36) (actual time=0.002..0.003 rows=1 loops=11)

  • Index Cond: ("Id" = "note.Visit"."PatientClassId")
43. 0.033 0.033 ↑ 1.0 1 11

Index Scan using "PK_Organizations" on "Organizations" "note.Visit.Organization" (cost=0.12..0.14 rows=1 width=228) (actual time=0.003..0.003 rows=1 loops=11)

  • Index Cond: ("note.Visit"."OrganizationId" = "Id")
44.          

SubPlan (for Nested Loop Left Join)

45. 0.033 0.198 ↑ 1.0 1 11

Aggregate (cost=8.31..8.32 rows=1 width=4) (actual time=0.018..0.018 rows=1 loops=11)

46. 0.165 0.165 ↑ 1.0 1 11

Index Only Scan using "IX_NoteHistories_NoteId" on "NoteHistories" n (cost=0.29..8.30 rows=1 width=0) (actual time=0.014..0.015 rows=1 loops=11)

  • Index Cond: ("NoteId" = note."Id")
  • Heap Fetches: 12
47. 0.011 0.165 ↑ 1.0 1 11

Aggregate (cost=8.31..8.32 rows=1 width=4) (actual time=0.015..0.015 rows=1 loops=11)

48. 0.154 0.154 ↑ 1.0 1 11

Index Only Scan using "IX_NoteDocuments_NoteId" on "NoteDocuments" n1 (cost=0.29..8.30 rows=1 width=0) (actual time=0.013..0.014 rows=1 loops=11)

  • Index Cond: ("NoteId" = note."Id")
  • Heap Fetches: 6
49. 0.022 0.044 ↑ 1.0 1 11

Result (cost=8.30..8.31 rows=1 width=1) (actual time=0.004..0.004 rows=1 loops=11)

50.          

Initplan (for Result)

51. 0.022 0.022 ↑ 1.0 1 11

Index Only Scan using "IX_NoteHistories_NoteId" on "NoteHistories" n3 (cost=0.29..8.30 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=11)

  • Index Cond: ("NoteId" = note."Id")
  • Heap Fetches: 11
52. 0.000 0.055 ↑ 1.0 1 11

Result (cost=16.34..16.35 rows=1 width=1) (actual time=0.005..0.005 rows=1 loops=11)

53.          

Initplan (for Result)

54. 0.011 0.055 ↓ 0.0 0 11

Nested Loop Semi Join (cost=0.29..16.34 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=11)

55. 0.033 0.033 ↓ 0.0 0 11

Index Scan using "IX_NoteAddendums_NoteId" on "NoteAddendums" na0 (cost=0.15..8.17 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=11)

  • Index Cond: (note."Id" = "NoteId")
56. 0.011 0.011 ↑ 1.0 1 1

Index Only Scan using "IX_NoteAddendumHistories_NoteAddendumId" on "NoteAddendumHistories" n5 (cost=0.15..8.17 rows=1 width=4) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: ("NoteAddendumId" = na0."Id")
  • Heap Fetches: 1
57. 0.000 0.033 ↑ 1.0 1 11

Result (cost=9.26..9.27 rows=1 width=1) (actual time=0.003..0.003 rows=1 loops=11)

58.          

Initplan (for Result)

59. 0.008 0.033 ↓ 0.0 0 11

Nested Loop (cost=0.15..9.26 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=11)

  • Join Filter: (a5."Id" = "a.NoteAddendumErroneous1"."NoteAddendumId")
  • Rows Removed by Join Filter: 0
60. 0.011 0.011 ↓ 0.0 0 11

Index Scan using "IX_NoteAddendums_NoteId" on "NoteAddendums" a5 (cost=0.15..8.17 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=11)

  • Index Cond: (note."Id" = "NoteId")
61. 0.014 0.014 ↑ 1.0 4 1

Seq Scan on "NoteAddendumsErroneous" "a.NoteAddendumErroneous1" (cost=0.00..1.04 rows=4 width=4) (actual time=0.014..0.014 rows=4 loops=1)

  • Filter: ("NoteAddendumId" IS NOT NULL)
Planning time : 43.726 ms
Execution time : 49.868 ms