explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Uyop

Settings
# exclusive inclusive rows x rows loops node
1. 0.554 2,542.126 ↓ 1.4 20 1

Sort (cost=49,673.00..49,673.04 rows=14 width=4,277) (actual time=2,542.058..2,542.126 rows=20 loops=1)

  • Sort Key: t5.""IsTop"" DESC, t5.""HasContractWithH24"" DESC, t5.""LastName"", ""p.Employees"".""PartyId"", ""e.Division0"".""Id"", l1.""Id"", ""p.Employees"".""Id"
  • Sort Method: quicksort Memory: 113kB
2. 0.300 2,541.572 ↓ 1.4 20 1

Nested Loop Left Join (cost=48,279.95..49,672.74 rows=14 width=4,277) (actual time=1,528.159..2,541.572 rows=20 loops=1)

3. 100.204 2,541.092 ↓ 1.4 20 1

Hash Join (cost=48,279.80..49,669.03 rows=14 width=4,069) (actual time=1,528.116..2,541.092 rows=20 loops=1)

  • Hash Cond: (""p.Employees"".""PartyId"" = t5.""Id"")
4. 213.920 1,690.900 ↑ 1.0 26,649 1

Hash Join (cost=2,007.10..3,296.25 rows=26,649 width=4,047) (actual time=524.925..1,690.900 rows=26,649 loops=1)

  • Hash Cond: (""p.Employees"".""PositionRefId"" = ""e.PositionRef"".""Id"")
5. 211.125 1,474.692 ↑ 1.0 26,649 1

Hash Left Join (cost=1,990.96..3,209.07 rows=26,649 width=3,811) (actual time=522.613..1,474.692 rows=26,649 loops=1)

  • Hash Cond: ((l1.""LegalFormRefValue"")::text = (""e.Division.LegalEntity.LegalFormRef"".""Value"")::text)
6. 207.742 1,263.412 ↑ 1.0 26,649 1

Hash Left Join (cost=1,989.60..3,119.87 rows=26,649 width=3,085) (actual time=522.433..1,263.412 rows=26,649 loops=1)

  • Hash Cond: (l1.""LogoId"" = ""e.Division.LegalEntity.Logo"".""Id"")
7. 214.207 966.128 ↑ 1.0 26,649 1

Hash Left Join (cost=1,510.30..2,570.59 rows=26,649 width=2,924) (actual time=432.804..966.128 rows=26,649 loops=1)

  • Hash Cond: (""e.Division0"".""LegalEntityId"" = l1.""Id"")
8. 216.299 732.660 ↑ 1.0 26,649 1

Hash Left Join (cost=1,266.32..2,256.48 rows=26,649 width=1,446) (actual time=413.514..732.660 rows=26,649 loops=1)

  • Hash Cond: (""p.Employees"".""DivisionId"" = ""e.Division0"".""Id"")
9. 102.882 102.882 ↑ 1.0 26,649 1

Seq Scan on ""Employees"" ""p.Employees"" (cost=0.00..641.49 rows=26,649 width=139) (actual time=0.008..102.882 rows=26,649 loops=1)

  • Filter: (NOT ""IsDeleted"")
10. 15.140 413.479 ↑ 1.0 2,571 1

Hash (cost=1,234.18..1,234.18 rows=2,571 width=1,307) (actual time=413.476..413.479 rows=2,571 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 2559kB
11. 23.679 398.339 ↑ 1.0 2,571 1

Hash Left Join (cost=325.98..1,234.18 rows=2,571 width=1,307) (actual time=25.179..398.339 rows=2,571 loops=1)

  • Hash Cond: (""e.Division0"".""TypeOfDivisionRefId"" = ""e.Division.TypeOfDivisionRef"".""Id"")
12. 184.227 373.942 ↑ 1.0 2,571 1

Hash Right Join (cost=320.85..1,222.00 rows=2,571 width=1,131) (actual time=24.442..373.942 rows=2,571 loops=1)

  • Hash Cond: (""e.Division.Location"".""Id"" = ""e.Division0"".""LocationId"")
13. 165.319 165.319 ↑ 1.0 43,528 1

Seq Scan on ""Locations"" ""e.Division.Location"" (cost=0.00..713.28 rows=43,528 width=24) (actual time=0.010..165.319 rows=43,528 loops=1)

14. 12.856 24.396 ↑ 1.0 2,571 1

Hash (cost=288.71..288.71 rows=2,571 width=1,107) (actual time=24.392..24.396 rows=2,571 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 2094kB
15. 11.540 11.540 ↑ 1.0 2,571 1

Seq Scan on ""Divisions"" ""e.Division0"" (cost=0.00..288.71 rows=2,571 width=1,107) (actual time=0.008..11.540 rows=2,571 loops=1)

16. 0.354 0.718 ↑ 1.0 95 1

Hash (cost=3.95..3.95 rows=95 width=176) (actual time=0.711..0.718 rows=95 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
17. 0.364 0.364 ↑ 1.0 95 1

Seq Scan on ""TypeOfDivisionRefs"" ""e.Division.TypeOfDivisionRef"" (cost=0.00..3.95 rows=95 width=176) (actual time=0.008..0.364 rows=95 loops=1)

18. 9.818 19.261 ↑ 1.0 1,554 1

Hash (cost=224.55..224.55 rows=1,554 width=1,478) (actual time=19.258..19.261 rows=1,554 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 1632kB
19. 9.443 9.443 ↑ 1.0 1,554 1

Seq Scan on ""LegalEntities"" l1 (cost=0.00..224.55 rows=1,554 width=1,478) (actual time=0.016..9.443 rows=1,554 loops=1)

  • Filter: (NOT ""IsDeleted"")
  • Rows Removed by Filter: 1
20. 44.882 89.542 ↑ 1.0 10,058 1

Hash (cost=353.58..353.58 rows=10,058 width=161) (actual time=89.539..89.542 rows=10,058 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 2065kB
21. 44.660 44.660 ↑ 1.0 10,058 1

Seq Scan on ""Files"" ""e.Division.LegalEntity.Logo"" (cost=0.00..353.58 rows=10,058 width=161) (actual time=0.015..44.660 rows=10,058 loops=1)

22. 0.080 0.155 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=726) (actual time=0.151..0.155 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
23. 0.075 0.075 ↑ 1.0 16 1

Seq Scan on ""LegalFormRefs"" ""e.Division.LegalEntity.LegalFormRef"" (cost=0.00..1.16 rows=16 width=726) (actual time=0.011..0.075 rows=16 loops=1)

24. 1.158 2.288 ↑ 1.0 273 1

Hash (cost=12.73..12.73 rows=273 width=236) (actual time=2.284..2.288 rows=273 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 82kB
25. 1.130 1.130 ↑ 1.0 273 1

Seq Scan on ""PositionRefs"" ""e.PositionRef"" (cost=0.00..12.73 rows=273 width=236) (actual time=0.009..1.130 rows=273 loops=1)

26. 0.052 749.988 ↑ 1.0 10 1

Hash (cost=46,272.58..46,272.58 rows=10 width=22) (actual time=749.984..749.988 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
27. 0.077 749.936 ↑ 1.0 10 1

Subquery Scan on t5 (cost=46,272.35..46,272.58 rows=10 width=22) (actual time=749.763..749.936 rows=10 loops=1)

28. 0.077 749.859 ↑ 1.0 10 1

Unique (cost=46,272.35..46,272.48 rows=10 width=22) (actual time=749.755..749.859 rows=10 loops=1)

29. 0.091 749.782 ↑ 1.0 10 1

Sort (cost=46,272.35..46,272.38 rows=10 width=22) (actual time=749.747..749.782 rows=10 loops=1)

  • Sort Key: p0.""Id"", p0.""IsTop"", p0.""HasContractWithH24"", p0.""LastName"
  • Sort Method: quicksort Memory: 25kB
30. 0.098 749.691 ↑ 1.0 10 1

Limit (cost=46,272.06..46,272.08 rows=10 width=22) (actual time=749.569..749.691 rows=10 loops=1)

31. 0.354 749.593 ↑ 3.6 10 1

Sort (cost=46,272.06..46,272.15 rows=36 width=22) (actual time=749.561..749.593 rows=10 loops=1)

  • Sort Key: p0.""IsTop"" DESC, p0.""HasContractWithH24"" DESC, p0.""LastName"", p0.""Id"
  • Sort Method: top-N heapsort Memory: 26kB
32. 0.549 749.239 ↓ 1.2 45 1

Nested Loop Semi Join (cost=43,678.40..46,271.28 rows=36 width=22) (actual time=506.300..749.239 rows=45 loops=1)

  • Join Filter: (p0.""Id"" = e3.""PartyId"")
33. 17.458 747.295 ↓ 1.0 45 1

Hash Semi Join (cost=43,677.83..46,239.10 rows=43 width=30) (actual time=506.237..747.295 rows=45 loops=1)

  • Hash Cond: (p0.""Id"" = e4.""PartyId"")
34. 67.482 728.645 ↑ 1.5 4,751 1

Hash Semi Join (cost=43,411.30..45,952.30 rows=7,043 width=26) (actual time=502.774..728.645 rows=4,751 loops=1)

  • Hash Cond: (p0.""Id"" = e2.""PartyId"")
35. 100.187 170.914 ↓ 1.0 13,009 1

Hash Join (cost=242.21..2,566.35 rows=12,523 width=22) (actual time=12.368..170.914 rows=13,009 loops=1)

  • Hash Cond: (p0.""LegalEntityId"" = l2.""Id"")
36. 58.393 58.393 ↑ 1.0 13,603 1

Seq Scan on ""Parties"" p0 (cost=0.00..2,287.86 rows=13,782 width=36) (actual time=0.009..58.393 rows=13,603 loops=1)

  • Filter: ""IsOnPortal"
  • Rows Removed by Filter: 6883
37. 5.917 12.334 ↑ 1.0 1,413 1

Hash (cost=224.55..224.55 rows=1,413 width=4) (actual time=12.330..12.334 rows=1,413 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 66kB
38. 6.417 6.417 ↑ 1.0 1,413 1

Seq Scan on ""LegalEntities"" l2 (cost=0.00..224.55 rows=1,413 width=4) (actual time=0.008..6.417 rows=1,413 loops=1)

  • Filter: ((NOT ""IsDeleted"") AND ""IsOnPortal"")
  • Rows Removed by Filter: 142
39. 34.250 490.249 ↑ 1.4 8,341 1

Hash (cost=43,025.07..43,025.07 rows=11,521 width=4) (actual time=490.246..490.249 rows=8,341 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 422kB
40. 123.158 455.999 ↑ 1.4 8,341 1

Hash Semi Join (cost=42,190.12..43,025.07 rows=11,521 width=4) (actual time=234.232..455.999 rows=8,341 loops=1)

  • Hash Cond: (e2.""DivisionId"" = d0.""Id"")
41. 98.882 98.882 ↑ 1.0 24,793 1

Seq Scan on ""Employees"" e2 (cost=0.00..641.49 rows=24,873 width=8) (actual time=0.011..98.882 rows=24,793 loops=1)

  • Filter: ((NOT ""IsDeleted"") AND (""DivisionId"" IS NOT NULL))
  • Rows Removed by Filter: 1856
42. 3.747 233.959 ↓ 1.3 974 1

Hash (cost=42,180.92..42,180.92 rows=736 width=4) (actual time=233.956..233.959 rows=974 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 43kB
43. 7.477 230.212 ↓ 1.3 974 1

Hash Join (cost=242.49..42,180.92 rows=736 width=4) (actual time=12.095..230.212 rows=974 loops=1)

  • Hash Cond: (d0.""LegalEntityId"" = l3.""Id"")
44. 24.715 211.055 ↓ 1.2 982 1

Index Scan using ""Divisions_IsOnPortal_idx"" on ""Divisions"" d0 (cost=0.28..41,936.57 rows=810 width=8) (actual time=0.391..211.055 rows=982 loops=1)

  • Filter: ((SubPlan 1) > 0)
  • Rows Removed by Filter: 1438
45.          

SubPlan (for Index Scan)

46. 31.460 186.340 ↑ 1.0 1 2,420

Aggregate (cost=17.06..17.07 rows=1 width=4) (actual time=0.074..0.077 rows=1 loops=2,420)

47. 44.216 154.880 ↓ 0.0 0 2,420

Nested Loop (cost=0.98..17.06 rows=1 width=0) (actual time=0.056..0.064 rows=0 loops=2,420)

  • Join Filter: (x0.""Address_Id"" = ""x.Address.AddressH240"".""Id"")
48. 48.762 94.380 ↑ 1.0 1 2,420

Nested Loop (cost=0.70..16.73 rows=1 width=8) (actual time=0.026..0.039 rows=1 loops=2,420)

49. 26.620 26.620 ↑ 1.0 1 2,420

Index Only Scan using ""PK_dbo.DivisionAddresses"" on ""DivisionAddresses"" x0 (cost=0.28..8.30 rows=1 width=4) (actual time=0.006..0.011 rows=1 loops=2,420)

  • Index Cond: (""Division_Id"" = d0.""Id"")
  • Heap Fetches: 2714
50. 18.998 18.998 ↑ 1.0 1 2,714

Index Only Scan using ""PK_dbo.Addresses"" on ""Addresses"" ""x.Address0"" (cost=0.42..8.44 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=2,714)

  • Index Cond: (""Id"" = x0.""Address_Id"")
  • Heap Fetches: 2714
51. 16.284 16.284 ↓ 0.0 0 2,714

Index Scan using ""PK_dbo.AddressH24"" on ""AddressH24"" ""x.Address.AddressH240"" (cost=0.29..0.31 rows=1 width=4) (actual time=0.006..0.006 rows=0 loops=2,714)

  • Index Cond: ((""Id"" = ""x.Address0"".""Id"") AND (""Id"" IS NOT NULL))
  • Filter: (""SettlementId"" = 29219)
  • Rows Removed by Filter: 1
52. 5.815 11.680 ↑ 1.0 1,413 1

Hash (cost=224.55..224.55 rows=1,413 width=4) (actual time=11.677..11.680 rows=1,413 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 66kB
53. 5.865 5.865 ↑ 1.0 1,413 1

Seq Scan on ""LegalEntities"" l3 (cost=0.00..224.55 rows=1,413 width=4) (actual time=0.008..5.865 rows=1,413 loops=1)

  • Filter: ((NOT ""IsDeleted"") AND ""IsOnPortal"")
  • Rows Removed by Filter: 142
54. 0.557 1.192 ↑ 1.0 124 1

Hash (cost=264.96..264.96 rows=126 width=4) (actual time=1.189..1.192 rows=124 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
55. 0.611 0.635 ↑ 1.0 124 1

Bitmap Heap Scan on ""Employees"" e4 (cost=5.26..264.96 rows=126 width=4) (actual time=0.039..0.635 rows=124 loops=1)

  • Recheck Cond: (""PositionRefId"" = 123)
  • Filter: (NOT ""IsDeleted"")
  • Heap Blocks: exact=81
56. 0.024 0.024 ↑ 1.0 124 1

Bitmap Index Scan on ""Employees_IX_PositionRefId"" (cost=0.00..5.23 rows=126 width=0) (actual time=0.021..0.024 rows=124 loops=1)

  • Index Cond: (""PositionRefId"" = 123)
57. 0.540 1.395 ↑ 1.0 1 45

Nested Loop (cost=0.57..0.74 rows=1 width=4) (actual time=0.031..0.031 rows=1 loops=45)

58. 0.495 0.495 ↑ 1.0 1 45

Index Scan using ""Employees_IX_PartyId"" on ""Employees"" e3 (cost=0.29..0.38 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=45)

  • Index Cond: (""PartyId"" = e2.""PartyId"")
  • Filter: ((NOT ""IsDeleted"") AND ""IsOnPortal"" AND (""DivisionId"" IS NOT NULL))
  • Rows Removed by Filter: 0
59. 0.360 0.360 ↑ 1.0 1 45

Index Scan using ""PK_dbo.Divisions"" on ""Divisions"" ""e.Division1"" (cost=0.28..0.36 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=45)

  • Index Cond: (""Id"" = e3.""DivisionId"")
  • Filter: ""IsOnPortal"
60. 0.180 0.180 ↑ 1.0 1 20

Index Scan using ""PK_dbo.PositionRangeRefs"" on ""PositionRangeRefs"" ""e.PositionRef.PositionRangeRef"" (cost=0.14..0.27 rows=1 width=208) (actual time=0.009..0.009 rows=1 loops=20)

  • Index Cond: (""e.PositionRef"".""PositionRangeRefId"" = ""Id"")
Planning time : 5.730 ms
Execution time : 2,543.131 ms