explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Hufe

Settings
# exclusive inclusive rows x rows loops node
1. 0.563 2,963.038 ↓ 1.3 18 1

Sort (cost=11,705.35..11,705.39 rows=14 width=4,276) (actual time=2,962.941..2,963.038 rows=18 loops=1)

  • Sort Key: t3.""IsTop"" DESC, t3.""HasContractWithH24"" DESC, t3.""LastName"", ""p.Employees"".""PartyId"", ""e.Division0"".""Id"", l0.""Id"", ""p.Employees"".""Id"
  • Sort Method: quicksort Memory: 90kB
2. 0.334 2,962.475 ↓ 1.3 18 1

Nested Loop Left Join (cost=10,293.48..11,705.08 rows=14 width=4,276) (actual time=1,697.539..2,962.475 rows=18 loops=1)

3. 101.210 2,961.925 ↓ 1.3 18 1

Hash Join (cost=10,293.34..11,701.37 rows=14 width=4,068) (actual time=1,697.497..2,961.925 rows=18 loops=1)

  • Hash Cond: (""p.Employees"".""PartyId"" = t3.""Id"")
4. 214.614 1,718.572 ↑ 1.0 27,021 1

Hash Join (cost=2,268.11..3,574.68 rows=27,021 width=4,046) (actual time=541.328..1,718.572 rows=27,021 loops=1)

  • Hash Cond: (""p.Employees"".""PositionRefId"" = ""e.PositionRef"".""Id"")
5. 215.494 1,501.697 ↑ 1.0 27,021 1

Hash Left Join (cost=2,251.97..3,486.50 rows=27,021 width=3,810) (actual time=539.043..1,501.697 rows=27,021 loops=1)

  • Hash Cond: ((l0.""LegalFormRefValue"")::text = (""e.Division.LegalEntity.LegalFormRef"".""Value"")::text)
6. 209.907 1,286.023 ↑ 1.0 27,021 1

Hash Left Join (cost=2,250.61..3,396.09 rows=27,021 width=3,084) (actual time=538.803..1,286.023 rows=27,021 loops=1)

  • Hash Cond: (l0.""LogoId"" = ""e.Division.LegalEntity.Logo"".""Id"")
7. 216.766 995.008 ↑ 1.0 27,021 1

Hash Left Join (cost=1,767.57..2,842.10 rows=27,021 width=2,923) (actual time=457.627..995.008 rows=27,021 loops=1)

  • Hash Cond: (""e.Division0"".""LegalEntityId"" = l0.""Id"")
8. 216.219 759.666 ↑ 1.0 27,021 1

Hash Left Join (cost=1,522.51..2,525.91 rows=27,021 width=1,445) (actual time=439.023..759.666 rows=27,021 loops=1)

  • Hash Cond: (""p.Employees"".""DivisionId"" = ""e.Division0"".""Id"")
9. 104.467 104.467 ↑ 1.0 27,021 1

Seq Scan on ""Employees"" ""p.Employees"" (cost=0.00..650.21 rows=27,021 width=139) (actual time=0.010..104.467 rows=27,021 loops=1)

  • Filter: (NOT ""IsDeleted"")
10. 14.665 438.980 ↑ 1.0 2,574 1

Hash (cost=1,490.33..1,490.33 rows=2,574 width=1,306) (actual time=438.977..438.980 rows=2,574 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 2567kB
11. 21.798 424.315 ↑ 1.0 2,574 1

Hash Left Join (cost=582.05..1,490.33 rows=2,574 width=1,306) (actual time=24.794..424.315 rows=2,574 loops=1)

  • Hash Cond: (""e.Division0"".""TypeOfDivisionRefId"" = ""e.Division.TypeOfDivisionRef"".""Id"")
12. 198.052 401.772 ↑ 1.0 2,574 1

Hash Right Join (cost=576.91..1,478.14 rows=2,574 width=1,130) (actual time=24.027..401.772 rows=2,574 loops=1)

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

Seq Scan on ""Locations"" ""e.Division.Location"" (cost=0.00..713.31 rows=43,531 width=24) (actual time=0.011..179.744 rows=43,531 loops=1)

14. 12.052 23.976 ↑ 1.0 2,574 1

Hash (cost=544.74..544.74 rows=2,574 width=1,106) (actual time=23.972..23.976 rows=2,574 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 2100kB
15. 11.924 11.924 ↑ 1.0 2,574 1

Seq Scan on ""Divisions"" ""e.Division0"" (cost=0.00..544.74 rows=2,574 width=1,106) (actual time=0.014..11.924 rows=2,574 loops=1)

16. 0.390 0.745 ↓ 1.0 96 1

Hash (cost=3.95..3.95 rows=95 width=176) (actual time=0.742..0.745 rows=96 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
17. 0.355 0.355 ↓ 1.0 96 1

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

18. 9.706 18.576 ↓ 1.0 1,559 1

Hash (cost=225.59..225.59 rows=1,558 width=1,478) (actual time=18.573..18.576 rows=1,559 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 1642kB
19. 8.870 8.870 ↓ 1.0 1,559 1

Seq Scan on ""LegalEntities"" l0 (cost=0.00..225.59 rows=1,558 width=1,478) (actual time=0.015..8.870 rows=1,559 loops=1)

  • Filter: (NOT ""IsDeleted"")
  • Rows Removed by Filter: 1
20. 40.832 81.108 ↑ 1.0 10,135 1

Hash (cost=356.35..356.35 rows=10,135 width=161) (actual time=81.105..81.108 rows=10,135 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 2080kB
21. 40.276 40.276 ↑ 1.0 10,135 1

Seq Scan on ""Files"" ""e.Division.LegalEntity.Logo"" (cost=0.00..356.35 rows=10,135 width=161) (actual time=0.012..40.276 rows=10,135 loops=1)

22. 0.091 0.180 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=726) (actual time=0.176..0.180 rows=16 loops=1)

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

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

24. 1.185 2.261 ↑ 1.0 273 1

Hash (cost=12.73..12.73 rows=273 width=236) (actual time=2.258..2.261 rows=273 loops=1)

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

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

26. 0.054 1,142.143 ↑ 1.0 10 1

Hash (cost=8,025.10..8,025.10 rows=10 width=22) (actual time=1,142.140..1,142.143 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
27. 0.074 1,142.089 ↑ 1.0 10 1

Subquery Scan on t3 (cost=8,024.88..8,025.10 rows=10 width=22) (actual time=1,141.921..1,142.089 rows=10 loops=1)

28. 0.075 1,142.015 ↑ 1.0 10 1

Unique (cost=8,024.88..8,025.00 rows=10 width=22) (actual time=1,141.913..1,142.015 rows=10 loops=1)

29. 0.081 1,141.940 ↑ 1.0 10 1

Sort (cost=8,024.88..8,024.90 rows=10 width=22) (actual time=1,141.906..1,141.940 rows=10 loops=1)

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

Limit (cost=8,024.59..8,024.61 rows=10 width=22) (actual time=1,141.767..1,141.859 rows=10 loops=1)

31. 18.818 1,141.790 ↑ 468.2 10 1

Sort (cost=8,024.59..8,036.29 rows=4,682 width=22) (actual time=1,141.759..1,141.790 rows=10 loops=1)

  • Sort Key: p0.""IsTop"" DESC, p0.""HasContractWithH24"" DESC, p0.""LastName"", p0.""Id"
  • Sort Method: top-N heapsort Memory: 26kB
32. 65.577 1,122.972 ↑ 1.0 4,654 1

Hash Join (cost=7,669.75..7,923.41 rows=4,682 width=22) (actual time=1,001.225..1,122.972 rows=4,654 loops=1)

  • Hash Cond: (e3.""PartyId"" = p0.""Id"")
33. 132.037 363.067 ↑ 1.2 12,486 1

HashAggregate (cost=1,313.13..1,466.15 rows=15,302 width=4) (actual time=306.846..363.067 rows=12,486 loops=1)

  • Group Key: e3.""PartyId"
34. 139.037 231.030 ↓ 1.1 18,172 1

Hash Join (cost=574.63..1,271.72 rows=16,565 width=4) (actual time=18.350..231.030 rows=18,172 loops=1)

  • Hash Cond: (e3.""DivisionId"" = ""e.Division1"".""Id"")
35. 73.678 73.678 ↓ 1.0 18,454 1

Seq Scan on ""Employees"" e3 (cost=0.00..650.21 rows=17,833 width=8) (actual time=0.009..73.678 rows=18,454 loops=1)

  • Filter: ((NOT ""IsDeleted"") AND ""IsOnPortal"" AND (""DivisionId"" IS NOT NULL))
  • Rows Removed by Filter: 8567
36. 8.846 18.315 ↑ 1.0 2,391 1

Hash (cost=544.74..544.74 rows=2,391 width=4) (actual time=18.312..18.315 rows=2,391 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 117kB
37. 9.469 9.469 ↑ 1.0 2,391 1

Seq Scan on ""Divisions"" ""e.Division1"" (cost=0.00..544.74 rows=2,391 width=4) (actual time=0.012..9.469 rows=2,391 loops=1)

  • Filter: ""IsOnPortal"
  • Rows Removed by Filter: 183
38. 18.716 694.328 ↑ 1.3 4,710 1

Hash (cost=6,282.52..6,282.52 rows=5,928 width=30) (actual time=694.325..694.328 rows=4,710 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 357kB
39. 93.614 675.612 ↑ 1.3 4,710 1

Hash Join (cost=5,952.50..6,282.52 rows=5,928 width=30) (actual time=508.860..675.612 rows=4,710 loops=1)

  • Hash Cond: (e4.""PartyId"" = p0.""Id"")
40. 174.881 280.036 ↑ 1.0 19,407 1

HashAggregate (cost=817.01..1,014.30 rows=19,729 width=4) (actual time=206.846..280.036 rows=19,407 loops=1)

  • Group Key: e4.""PartyId"
41. 105.155 105.155 ↑ 1.0 26,190 1

Seq Scan on ""Employees"" e4 (cost=0.00..751.54 rows=26,190 width=4) (actual time=0.013..105.155 rows=26,190 loops=1)

  • Filter: ((NOT ""IsDeleted"") AND ((""EmployeeTypeRefValue"")::text = ANY ('{DOCTOR,SPECIALIST,ASSISTANT}'::text[])))
  • Rows Removed by Filter: 831
42. 18.792 301.962 ↑ 1.3 4,720 1

Hash (cost=5,057.42..5,057.42 rows=6,245 width=26) (actual time=301.959..301.962 rows=4,720 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 339kB
43. 34.996 283.170 ↑ 1.3 4,720 1

Hash Join (cost=2,573.62..5,057.42 rows=6,245 width=26) (actual time=125.370..283.170 rows=4,720 loops=1)

  • Hash Cond: (p0.""LegalEntityId"" = l1.""Id"")
44. 66.747 237.241 ↑ 1.5 4,722 1

Hash Join (cost=2,330.35..4,796.04 rows=6,885 width=30) (actual time=114.411..237.241 rows=4,722 loops=1)

  • Hash Cond: (p0.""Id"" = e2.""PartyId"")
45. 56.245 56.245 ↑ 1.0 13,205 1

Seq Scan on ""Parties"" p0 (cost=0.00..2,352.70 rows=13,863 width=36) (actual time=0.010..56.245 rows=13,205 loops=1)

  • Filter: ""IsOnPortal"
  • Rows Removed by Filter: 7569
46. 18.805 114.249 ↑ 2.0 4,824 1

Hash (cost=2,210.03..2,210.03 rows=9,626 width=4) (actual time=114.246..114.249 rows=4,824 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 298kB
47. 57.396 95.444 ↑ 2.0 4,824 1

HashAggregate (cost=2,113.77..2,210.03 rows=9,626 width=4) (actual time=77.508..95.444 rows=4,824 loops=1)

  • Group Key: e2.""PartyId"
48. 38.048 38.048 ↑ 1.3 8,289 1

Index Scan using ""Employees_IX_DivisionId"" on ""Employees"" e2 (cost=0.29..2,087.73 rows=10,415 width=4) (actual time=0.128..38.048 rows=8,289 loops=1)

  • Index Cond: ((""DivisionId"" IS NOT NULL) AND (""DivisionId"" = ANY ('{795,815,867,868,933,939,940,946,947,948,949,951,952,953,954,956,2532,959,960,961,962,964,967,968,969,971,972,973,974,975,976,977,979,2468,981,982,983,984,986,988,989,990,992,994,995,996,997,999,1000,1002,1003,1969,1004,1006,1007,1008,1009,1010,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1025,1026,1027,1030,1031,1032,1033,1034,1035,1036,1037,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1054,1055,1057,1058,1059,1060,1061,1062,1077,1092,1094,1105,1106,1107,1109,1111,1112,1114,1115,1116,1117,1118,1121,1122,1124,1125,1126,1128,1129,1131,1132,1133,1134,1135,1136,1137,1139,1140,1144,1145,1146,1147,1148,1149,1150,1154,1155,1157,1158,1159,1160,1161,1162,1164,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,886,1071,1204,1205,1207,1079,1080,1208,1209,1210,1211,1212,1213,1214,1085,1215,1216,1218,1086,1219,1237,1238,1239,1240,1242,1243,1244,1245,1246,1247,1248,1249,1250,1251,1252,1273,1281,1298,1299,1301,1304,1110,1305,1306,1307,1308,1310,1311,1312,1313,1314,1316,1317,1319,1320,1321,1322,1323,1324,1325,1326,1327,1328,1120,1330,1331,1332,1333,1334,1335,1336,1337,1338,1339,1340,1341,1343,1344,1345,1346,1347,1348,1349,1350,1351,1353,1354,1355,1356,1358,1068,1359,1360,1070,1365,1073,1366,1088,1367,1089,1368,1370,1371,1372,1375,1376,1377,1378,1379,1380,1381,1389,1390,1392,1394,1395,1397,1399,1400,1401,1402,1405,1409,1410,1411,1412,1413,1414,1419,1420,1421,1423,1424,1425,1426,1427,1428,1431,1435,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1300,1396,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1462,1463,1465,1466,1467,1468,1469,1303,1475,1476,1482,1483,1484,1485,1487,1489,1490,1491,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1513,1514,1515,1516,1517,1518,1519,1521,1522,1525,1526,1527,1528,1536,1537,1538,1539,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,1550,1551,1552,1553,1554,1555,1557,1559,1560,1561,1562,1563,1564,1565,1566,1567,1568,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599,1600,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,1619,1620,1622,1623,1624,1625,1626,1628,1629,1630,1632,1633,1634,1635,1636,1637,1638,1639,1631,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,2758,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1705,1706,1056,1102,1748,1749,1754,1755,1756,1757,1758,1759,1764,1765,1766,1769,1770,1772,1773,1774,1776,1777,1780,1781,1782,1783,1784,1785,1788,1789,1790,1791,993,1352,1792,1793,1474,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1805,1807,1808,1809,1810,1811,1812,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1823,1024,1824,1825,1826,1828,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1840,1841,1842,1843,1844,1845,1846,1847,1848,1851,1852,1854,1855,1856,1857,1858,1859,1860,1861,1862,1864,1865,1866,1867,1868,1869,1870,1871,1872,1873,1874,1875,1876,1877,1878,1881,1882,1488,1512,1884,1885,1887,1888,1889,1890,1891,1892,1893,1895,1896,1097,1936,1939,1942,1943,1944,1082,1083,1104,1948,1949,1091,1093,955,1950,1951,1952,1959,1960,1961,1962,1963,1084,1964,1965,1966,1968,1970,1971,1972,1973,1975,1315,1976,1977,1979,1980,1981,1974,1391,1398,1523,1982,1983,1984,1985,1318,1986,1987,1988,1989,1990,1991,1992,1993,1994,1996,1997,2000,2001,2002,2003,1806,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2017,2018,1656,2019,2020,2021,2022,2023,2024,2025,2039,2040,2041,1953,2044,2045,2046,2047,1863,2048,2049,2051,2052,2053,1995,2055,2056,2058,2060,2061,2062,2063,2064,2065,2066,2067,2068,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2098,2099,2100,2101,2102,2103,2104,2503,2105,2106,2107,2108,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2142,2143,2144,2145,2146,2147,2148,2150,2151,2152,2153,2154,2155,2156,2157,2158,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2179,2180,2181,2183,2184,2185,2186,2187,2188,2189,2190,2192,2193,2194,2195,2196,2197,2198,2199,2201,2202,2203,2204,2205,2207,2208,2209,2214,2215,2216,2217,2218,2219,2220,2226,2229,2230,2239,2240,2241,2244,2245,2256,2257,2259,2260,2261,2262,2263,2264,2265,2266,2267,2269,2270,2271,2276,2277,2278,2511,980,2301,755,771,782,793,978,1778,1894,2517,2149,2717,2615,2824,2861,2862,2863,2898,3124,3138,3179,3296,3299,3300,3455}'::integer[])))
  • Filter: (NOT ""IsDeleted"")
49. 5.287 10.933 ↑ 1.0 1,414 1

Hash (cost=225.59..225.59 rows=1,414 width=4) (actual time=10.929..10.933 rows=1,414 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 66kB
50. 5.646 5.646 ↑ 1.0 1,414 1

Seq Scan on ""LegalEntities"" l1 (cost=0.00..225.59 rows=1,414 width=4) (actual time=0.012..5.646 rows=1,414 loops=1)

  • Filter: ((NOT ""IsDeleted"") AND ""IsOnPortal"")
  • Rows Removed by Filter: 146
51. 0.216 0.216 ↑ 1.0 1 18

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

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