explain.depesz.com

PostgreSQL's explain analyze made readable

Result: f8jf

Settings
# exclusive inclusive rows x rows loops node
1. 24.898 4,911.691 ↓ 114.7 2,753 1

GroupAggregate (cost=35,926.86..35,927.34 rows=24 width=18) (actual time=4,879.235..4,911.691 rows=2,753 loops=1)

  • Group Key: fub_agentreassignment.reassigned_agent_id, fub_lead.stage
2. 55.551 4,886.793 ↓ 4,635.6 111,254 1

Sort (cost=35,926.86..35,926.92 rows=24 width=14) (actual time=4,879.217..4,886.793 rows=111,254 loops=1)

  • Sort Key: fub_agentreassignment.reassigned_agent_id, fub_lead.stage
  • Sort Method: quicksort Memory: 8,888kB
3. 7.720 4,831.242 ↓ 4,635.6 111,254 1

Gather (cost=9,485.86..35,926.31 rows=24 width=14) (actual time=1,301.407..4,831.242 rows=111,254 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 36.215 4,823.522 ↓ 3,708.5 37,085 3 / 3

Nested Loop (cost=8,485.86..34,923.91 rows=10 width=14) (actual time=1,296.722..4,823.522 rows=37,085 loops=3)

  • Join Filter: (fub_agentreassignment.lead_id = fub_call.lead_id)
5. 89.406 1,498.428 ↓ 3.7 23,661 3 / 3

Hash Join (cost=8,485.43..31,752.41 rows=6,466 width=22) (actual time=1,293.783..1,498.428 rows=23,661 loops=3)

  • Hash Cond: ((fub_lead.id = fub_agentreassignment.lead_id) AND (fub_lead.buyer_agent_id = fub_agentreassignment.reassigned_agent_id))
6. 116.553 116.553 ↑ 1.2 250,496 3 / 3

Parallel Index Only Scan using fub_lead_customer_id_crm_created_at_buyer_agent_id_stage_id_idx on fub_lead (cost=0.43..16,163.65 rows=312,849 width=14) (actual time=0.063..116.553 rows=250,496 loops=3)

  • Index Cond: (customer_id = 4)
  • Heap Fetches: 18,461
7. 56.482 1,292.469 ↑ 1.0 175,497 3 / 3

Hash (cost=5,837.80..5,837.80 rows=176,480 width=8) (actual time=1,292.469..1,292.469 rows=175,497 loops=3)

  • Buckets: 262,144 Batches: 1 Memory Usage: 8,904kB
8. 1,235.987 1,235.987 ↑ 1.0 175,497 3 / 3

Index Only Scan using fub_agentreassignment_customer_id_reassigned_agent_id_crm_c_idx on fub_agentreassignment (cost=0.43..5,837.80 rows=176,480 width=8) (actual time=2.612..1,235.987 rows=175,497 loops=3)

  • Index Cond: ((customer_id = 4) AND (reassigned_agent_id = ANY ('{628,630,632,634,638,640,652,663,690,693,699,702,704,707,713,719,729,731,733,735,737,739,741,743,747,753,755,757,759,761,763,765,767,778,780,782,784,786,788,794,796,798,800,806,818,820,823,826,827,831,833,835,837,839,845,847,851,855,857,862,867,868,877,879,883,890,892,894,898,900,904,906,912,914,917,918,920,924,930,933,935,940,943,946,949,952,955,958,965,977,980,993,999,1003,1006,1033,1036,1039,1042,1045,1048,1051,1054,1057,1060,1063,1066,1069,1072,1075,1088,1091,1094,1097,1100,1103,1106,1109,1115,1118,1121,1124,1130,1136,1139,1142,1145,1148,1151,1154,1157,1163,1166,1172,1175,1181,1184,1190,1192,1196,1199,1200,1203,1206,1209,1215,1218,1224,1227,1236,1239,1245,1248,1251,1257,1263,1269,1272,1275,1278,1281,1284,1287,1290,1293,1296,1299,1302,1305,1311,1317,1321,1324,1328,1335,1338,1341,1344,1347,1350,1353,1365,1368,1374,1377,1383,1386,1389,1392,1395,1398,1401,1404,1407,1410,1413,1416,1419,1422,1424,1427,1433,1437,1443,1450,1453,1459,1462,1465,1468,1471,1474,1477,1480,1483,1486,1501,1504,1507,1510,1513,1516,1520,1523,1526,1532,1535,1538,1541,1547,1550,1553,1556,1562,1571,1586,1589,1592,1598,1613,1616,1619,1622,1625,1628,1632,1636,1639,1644,1647,1650,1652,1655,1670,1683,1686,1689,1692,1701,1703,1706,1709,1712,1715,1718,1721,1724,1727,1731,1734,1737,1740,1743,1746,1749,1752,1755,1758,1761,1764,1767,1770,1773,1782,1785,1788,1791,1794,1797,1799,1802,1809,1812,1815,1818,1821,1827,1830,1833,1836,1842,1848,1850,1852,1855,1857,1859,1861,1863,1865,1867,1869,1871,1873,1875,1877,1879,1880,1883,1885,1886,1888,1890,1892,1894,1896,1898,1900,1902,1903,1906,1908,1910,1912,1914,1920,1923,1925,1927,1929,1931,1932,1935,1937,1939,1945,1947,1949,1951,1953,1955,1957,1961,1963,1967,1969,1971,1973,1977,1979,1981,1985,1987,1989,1991,1993,1995,3244,3290,3341,3342,3409,3435,3566,3601,3667,3668,3669,3670,3671,3911,3912,3913,3915,3917,3918,3919,3920,3965,3996,4031,4032,4135,4136,4137,4148,4163,4165,4166,4192,4193,4203,4204,4205,4206,4207,4233,4265,4266,4267,4295,4324,4357,4358,4359,4423,4424,4560,4561,4562,4563,4592,4593,4594,4606,4610,4617,4618,4620,4637,4654,4696,4697,4698,4699,4757,4758,4824,4825,4826,4827,4828,4861,4862,4863,4864,4865,4885,4991,4992,4993,4994,5029,5030,5031,5083,5084,5086,5087,5186,5416,5418,5479,5513,5515,5516,5547,5548,5549,5550,5551,5552,5743,5751,5752,5753,5754,5755,5780,5781,5782,5915,5916,5918,6043,6048,6377,6414,6436,6437,6438,6439,6440,6634,6636,6637,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648,6869,6870,6871,6872,7000,7100,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7363,7365,7432,7433,7434,7435,7436,7439,7440,7441,7443,7444,7445,7446,7447,7448,7562,7657,8240,8350,8647,8979,9044,9045,9046,9047,9048,9077,9078,9079,9080,9109,9162,9266,9274,9307,9472,9604,9637,9670,9703,9736,9828,9835,9836,9868,9901,9934,9967,10231,10264,10297,10330,10331,10332,10333,10478,10495,10528,10614,10627,10678,10726,10825,10858,11056,11089,11221,11320,11321,11386,11683,11684,11846,11847,11848,11849,11850,11851,11852,11914}'::integer[])) AND (crm_created_at >= '2020-01-01 04:00:00+00'::timestamp with time zone) AND (crm_created_at <= '2020-09-03 04:00:00+00'::timestamp with time zone))
  • Heap Fetches: 20,707
9. 3,288.879 3,288.879 ↓ 2.0 2 70,983 / 3

Index Only Scan using call_lead_agent_id_idx on fub_call (cost=0.43..0.48 rows=1 width=12) (actual time=0.095..0.139 rows=2 loops=70,983)

  • Index Cond: ((lead_id = fub_lead.id) AND (agent_id = fub_lead.buyer_agent_id))
  • Heap Fetches: 15,111
Planning time : 4.484 ms
Execution time : 4,913.395 ms