explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aZpH

Settings
# exclusive inclusive rows x rows loops node
1. 0.174 11.710 ↑ 1.0 1 1

Aggregate (cost=1,800.37..1,800.39 rows=1 width=4) (actual time=11.704..11.710 rows=1 loops=1)

2. 0.454 11.536 ↓ 2.0 45 1

Nested Loop Semi Join (cost=267.26..1,800.32 rows=22 width=0) (actual time=1.252..11.536 rows=45 loops=1)

  • Join Filter: (p.""Id"" = e1.""PartyId"")
3. 0.461 7.707 ↓ 1.4 45 1

Nested Loop Semi Join (cost=266.70..1,212.17 rows=33 width=16) (actual time=1.166..7.707 rows=45 loops=1)

4. 0.523 6.166 ↓ 1.1 45 1

Nested Loop (cost=266.13..1,180.00 rows=40 width=12) (actual time=1.129..6.166 rows=45 loops=1)

5. 0.912 5.373 ↓ 1.0 45 1

Nested Loop Semi Join (cost=265.85..1,164.26 rows=44 width=16) (actual time=1.107..5.373 rows=45 loops=1)

6. 1.187 3.401 ↓ 1.2 106 1

Nested Loop (cost=265.56..1,023.31 rows=85 width=12) (actual time=1.087..3.401 rows=106 loops=1)

7. 0.879 1.458 ↑ 1.2 108 1

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

  • Group Key: e2.""PartyId"
8. 0.561 0.579 ↑ 1.0 124 1

Bitmap Heap Scan on ""Employees"" e2 (cost=5.26..264.96 rows=126 width=4) (actual time=0.056..0.579 rows=124 loops=1)

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

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

  • Index Cond: (""PositionRefId"" = 123)
10. 0.756 0.756 ↑ 1.0 1 108

Index Scan using ""PK_dbo.Parties"" on ""Parties"" p (cost=0.29..6.05 rows=1 width=8) (actual time=0.007..0.007 rows=1 loops=108)

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

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

  • Index Cond: (""PartyId"" = p.""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
12. 0.270 0.270 ↑ 1.0 1 45

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

  • Index Cond: (""Id"" = p.""LegalEntityId"")
  • Filter: ((NOT ""IsDeleted"") AND ""IsOnPortal"")
13. 0.495 1.080 ↑ 1.0 1 45

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

14. 0.270 0.270 ↑ 1.0 1 45

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

  • Index Cond: (""PartyId"" = p.""Id"")
  • Filter: ((NOT ""IsDeleted"") AND ""IsOnPortal"" AND (""DivisionId"" IS NOT NULL))
  • Rows Removed by Filter: 0
15. 0.315 0.315 ↑ 1.0 1 45

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

  • Index Cond: (""Id"" = e0.""DivisionId"")
  • Filter: ""IsOnPortal"
16. 0.708 3.375 ↑ 1.0 1 45

Nested Loop Left Join (cost=0.57..17.81 rows=1 width=4) (actual time=0.075..0.075 rows=1 loops=45)

  • Filter: (SubPlan 1)
  • Rows Removed by Filter: 0
17. 0.270 0.270 ↑ 1.0 1 45

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

  • Index Cond: (""PartyId"" = e0.""PartyId"")
  • Filter: (NOT ""IsDeleted"")
18. 0.282 0.282 ↑ 1.0 1 47

Index Only Scan using ""PK_dbo.Divisions"" on ""Divisions"" ""e.Division0"" (cost=0.28..0.34 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=47)

  • Index Cond: (""Id"" = e1.""DivisionId"")
  • Heap Fetches: 46
19.          

SubPlan (for Nested Loop Left Join)

20. 0.524 2.115 ↑ 1.0 1 47

Nested Loop (cost=0.98..17.06 rows=1 width=0) (actual time=0.045..0.045 rows=1 loops=47)

  • Join Filter: (a.""Address_Id"" = ""a.AddressH24"".""Id"")
21. 0.573 1.269 ↑ 1.0 1 47

Nested Loop (cost=0.70..16.73 rows=1 width=8) (actual time=0.027..0.027 rows=1 loops=47)

22. 0.282 0.282 ↑ 1.0 1 47

Index Only Scan using ""PK_dbo.DivisionAddresses"" on ""DivisionAddresses"" a (cost=0.28..8.30 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=47)

  • Index Cond: (""Division_Id"" = ""e.Division0"".""Id"")
  • Heap Fetches: 46
23. 0.414 0.414 ↑ 1.0 1 46

Index Only Scan using ""PK_dbo.Addresses"" on ""Addresses"" ""a.Address"" (cost=0.42..8.44 rows=1 width=4) (actual time=0.008..0.009 rows=1 loops=46)

  • Index Cond: (""Id"" = a.""Address_Id"")
  • Heap Fetches: 46
24. 0.322 0.322 ↑ 1.0 1 46

Index Scan using ""PK_dbo.AddressH24"" on ""AddressH24"" ""a.AddressH24"" (cost=0.29..0.31 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=46)

  • Index Cond: ((""Id"" = ""a.Address"".""Id"") AND (""Id"" IS NOT NULL))
  • Filter: (""SettlementId"" = 29219)
  • Rows Removed by Filter: 0
Planning time : 3.322 ms
Execution time : 11.949 ms