explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mdAS

Settings
# exclusive inclusive rows x rows loops node
1. 7.608 508.982 ↓ 250.4 2,754 1

GroupAggregate (cost=23,218.49..23,218.71 rows=11 width=18) (actual time=498.927..508.982 rows=2,754 loops=1)

  • Group Key: fub_agentreassignment.reassigned_agent_id, fub_lead.stage
2. 21.610 501.374 ↓ 3,536.9 38,906 1

Sort (cost=23,218.49..23,218.52 rows=11 width=14) (actual time=498.908..501.374 rows=38,906 loops=1)

  • Sort Key: fub_agentreassignment.reassigned_agent_id, fub_lead.stage
  • Sort Method: quicksort Memory: 3,565kB
3. 15.959 479.764 ↓ 3,536.9 38,906 1

Gather (cost=9,485.43..23,218.30 rows=11 width=14) (actual time=156.277..479.764 rows=38,906 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 30.046 463.805 ↓ 3,242.2 19,453 2 / 2

Nested Loop (cost=8,485.43..22,217.20 rows=6 width=14) (actual time=161.249..463.805 rows=19,453 loops=2)

  • Join Filter: ((fub_agentreassignment.lead_id = fub_lead.id) AND (fub_agentreassignment.reassigned_agent_id = fub_lead.buyer_agent_id))
5. 92.004 278.941 ↓ 209.2 38,704 2 / 2

Hash Join (cost=8,485.00..22,046.89 rows=185 width=20) (actual time=161.216..278.941 rows=38,704 loops=2)

  • Hash Cond: ((fub_call_etl.lead_id = fub_agentreassignment.lead_id) AND (fub_call_etl.agent_id = fub_agentreassignment.reassigned_agent_id))
6. 32.789 32.789 ↑ 1.2 279,376 2 / 2

Parallel Seq Scan on fub_call_etl (cost=0.00..6,164.78 rows=328,678 width=12) (actual time=0.007..32.789 rows=279,376 loops=2)

7. 54.299 154.148 ↑ 1.0 175,497 2 / 2

Hash (cost=5,837.80..5,837.80 rows=176,480 width=8) (actual time=154.148..154.148 rows=175,497 loops=2)

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

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=0.085..99.849 rows=175,497 loops=2)

  • 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: 13,846
9. 154.818 154.818 ↑ 1.0 1 77,409 / 2

Index Scan using fub_lead_pkey on fub_lead (cost=0.43..0.91 rows=1 width=14) (actual time=0.004..0.004 rows=1 loops=77,409)

  • Index Cond: (id = fub_call_etl.lead_id)
  • Filter: ((customer_id = 4) AND (fub_call_etl.agent_id = buyer_agent_id))
  • Rows Removed by Filter: 0
Planning time : 2.601 ms
Execution time : 510.094 ms