explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zQco

Settings
# exclusive inclusive rows x rows loops node
1. 0.607 1,819.669 ↓ 1.4 20 1

Sort (cost=4,613.83..4,613.86 rows=14 width=4,277) (actual time=1,819.599..1,819.669 rows=20 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: 113kB
2. 0.304 1,819.062 ↓ 1.4 20 1

Nested Loop Left Join (cost=3,220.77..4,613.56 rows=14 width=4,277) (actual time=787.226..1,819.062 rows=20 loops=1)

3. 102.719 1,818.558 ↓ 1.4 20 1

Hash Join (cost=3,220.63..4,609.85 rows=14 width=4,069) (actual time=787.174..1,818.558 rows=20 loops=1)

  • Hash Cond: (""p.Employees"".""PartyId"" = t3.""Id"")
4. 219.601 1,707.325 ↑ 1.0 26,649 1

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

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

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

  • Hash Cond: ((l0.""LegalFormRefValue"")::text = (""e.Division.LegalEntity.LegalFormRef"".""Value"")::text)
6. 212.110 1,270.184 ↑ 1.0 26,649 1

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

  • Hash Cond: (l0.""LogoId"" = ""e.Division.LegalEntity.Logo"".""Id"")
7. 219.338 972.466 ↑ 1.0 26,649 1

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

  • Hash Cond: (""e.Division0"".""LegalEntityId"" = l0.""Id"")
8. 217.106 736.170 ↑ 1.0 26,649 1

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

  • Hash Cond: (""p.Employees"".""DivisionId"" = ""e.Division0"".""Id"")
9. 103.800 103.800 ↑ 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..103.800 rows=26,649 loops=1)

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

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

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

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

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

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

  • Hash Cond: (""e.Division.Location"".""Id"" = ""e.Division0"".""LocationId"")
13. 161.194 161.194 ↑ 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.011..161.194 rows=43,528 loops=1)

14. 12.775 26.295 ↑ 1.0 2,571 1

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

  • Buckets: 4096 Batches: 1 Memory Usage: 2094kB
15. 13.520 13.520 ↑ 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..13.520 rows=2,571 loops=1)

16. 0.364 0.714 ↑ 1.0 95 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
17. 0.350 0.350 ↑ 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.350 rows=95 loops=1)

18. 8.995 16.958 ↑ 1.0 1,554 1

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

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

Seq Scan on ""LegalEntities"" l0 (cost=0.00..224.55 rows=1,554 width=1,478) (actual time=0.021..7.963 rows=1,554 loops=1)

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

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

  • Buckets: 16384 Batches: 1 Memory Usage: 2065kB
21. 42.354 42.354 ↑ 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.012..42.354 rows=10,058 loops=1)

22. 0.119 0.230 ↑ 1.0 16 1

Hash (cost=1.16..1.16 rows=16 width=726) (actual time=0.227..0.230 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
23. 0.111 0.111 ↑ 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.111 rows=16 loops=1)

24. 1.081 2.144 ↑ 1.0 273 1

Hash (cost=12.73..12.73 rows=273 width=236) (actual time=2.141..2.144 rows=273 loops=1)

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

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

26. 0.062 8.514 ↑ 1.0 10 1

Hash (cost=1,213.40..1,213.40 rows=10 width=22) (actual time=8.511..8.514 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
27. 0.154 8.452 ↑ 1.0 10 1

Subquery Scan on t3 (cost=1,213.17..1,213.40 rows=10 width=22) (actual time=8.197..8.452 rows=10 loops=1)

28. 0.079 8.298 ↑ 1.0 10 1

Unique (cost=1,213.17..1,213.30 rows=10 width=22) (actual time=8.190..8.298 rows=10 loops=1)

29. 0.085 8.219 ↑ 1.0 10 1

Sort (cost=1,213.17..1,213.20 rows=10 width=22) (actual time=8.183..8.219 rows=10 loops=1)

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

Limit (cost=1,212.88..1,212.91 rows=10 width=22) (actual time=7.947..8.134 rows=10 loops=1)

31. 0.319 7.997 ↑ 3.3 10 1

Sort (cost=1,212.88..1,212.96 rows=33 width=22) (actual time=7.940..7.997 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.520 7.678 ↓ 1.4 45 1

Nested Loop Semi Join (cost=266.70..1,212.17 rows=33 width=22) (actual time=1.181..7.678 rows=45 loops=1)

33. 0.563 6.123 ↓ 1.1 45 1

Nested Loop (cost=266.13..1,180.00 rows=40 width=30) (actual time=1.137..6.123 rows=45 loops=1)

34. 0.861 5.290 ↓ 1.0 45 1

Nested Loop Semi Join (cost=265.85..1,164.26 rows=44 width=34) (actual time=1.114..5.290 rows=45 loops=1)

35. 1.173 3.369 ↓ 1.2 106 1

Nested Loop (cost=265.56..1,023.31 rows=85 width=30) (actual time=1.089..3.369 rows=106 loops=1)

36. 0.934 1.548 ↑ 1.2 108 1

HashAggregate (cost=265.28..266.54 rows=126 width=4) (actual time=1.064..1.548 rows=108 loops=1)

  • Group Key: e4.""PartyId"
37. 0.583 0.614 ↑ 1.0 124 1

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

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

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

  • Index Cond: (""PositionRefId"" = 123)
39. 0.648 0.648 ↑ 1.0 1 108

Index Scan using ""PK_dbo.Parties"" on ""Parties"" p0 (cost=0.29..6.05 rows=1 width=36) (actual time=0.006..0.006 rows=1 loops=108)

  • Index Cond: (""Id"" = e4.""PartyId"")
  • Filter: ""IsOnPortal"
  • Rows Removed by Filter: 0
40. 1.060 1.060 ↓ 0.0 0 106

Index Scan using ""Employees_IX_PartyId"" on ""Employees"" e2 (cost=0.29..1.65 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=106)

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

Index Scan using ""PK_dbo.LegalEntities"" on ""LegalEntities"" l1 (cost=0.28..0.36 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=45)

  • Index Cond: (""Id"" = p0.""LegalEntityId"")
  • Filter: ((NOT ""IsDeleted"") AND ""IsOnPortal"")
42. 0.495 1.035 ↑ 1.0 1 45

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

43. 0.270 0.270 ↑ 1.0 1 45

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

  • Index Cond: (""PartyId"" = p0.""Id"")
  • Filter: ((NOT ""IsDeleted"") AND ""IsOnPortal"" AND (""DivisionId"" IS NOT NULL))
  • Rows Removed by Filter: 0
44. 0.270 0.270 ↑ 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.006..0.006 rows=1 loops=45)

  • Index Cond: (""Id"" = e3.""DivisionId"")
  • Filter: ""IsOnPortal"
45. 0.200 0.200 ↑ 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.010..0.010 rows=1 loops=20)

  • Index Cond: (""e.PositionRef"".""PositionRangeRefId"" = ""Id"")
Planning time : 5.887 ms
Execution time : 1,820.632 ms