explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9HAE

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=5,893.39..5,998.77 rows=7,025 width=45) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Unique (cost=5,893.39..5,998.77 rows=7,025 width=45) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=5,893.39..5,910.96 rows=7,025 width=45) (actual rows= loops=)

  • Sort Key: agent_companies.company_name, agents.lastname, agents.firstname, agents.id, agents.promo_code
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=245.18..5,444.56 rows=7,025 width=45) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Hash Join (cost=244.75..615.74 rows=430 width=45) (actual rows= loops=)

  • Hash Cond: (agents.agent_company_id = agent_companies.id)
6. 0.000 0.000 ↓ 0.0

Seq Scan on agents (cost=0.00..355.59 rows=2,960 width=32) (actual rows= loops=)

  • Filter: ((NOT inactive) AND (promo_code IS NOT NULL))
7. 0.000 0.000 ↓ 0.0

Hash (cost=239.64..239.64 rows=409 width=21) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Hash Join (cost=98.72..239.64 rows=409 width=21) (actual rows= loops=)

  • Hash Cond: (agent_companies.ma_id = master_agents.id)
9. 0.000 0.000 ↓ 0.0

Seq Scan on agent_companies (cost=0.00..129.18 rows=2,040 width=25) (actual rows= loops=)

  • Filter: ((NOT comm_only) AND (NOT inactive))
10. 0.000 0.000 ↓ 0.0

Hash (cost=95.02..95.02 rows=296 width=4) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Only Scan using master_agents_pkey on master_agents (cost=0.28..95.02 rows=296 width=4) (actual rows= loops=)

  • Index Cond: (id = ANY ('{6158,3519,6810,2254,18577,5134,4198,4905,2838,3086,6819,644,6575,1389,12672,480,3492,2650,595,1958,2230,2004,2438,2183,6714,3853,13020,1427,5127,1776,1575,6618,6243,12926,17785,5899,2407,3900,5920,2408,16505,13698,876,5660,2777,5253,1426,6173,5359,1868,4235,3172,2291,4232,1438,1423,4231,2252,2548,5136,591,481,5896,2434,6812,2829,6541,2014,2253,6591,6231,6652,2960,592,5709,1421,13697,19599,2334,1539,13021,4185,1933,2427,4100,1502,2229,1777,13337,1718,479,3899,1744,1771,13332,13333,17784,6350,843,6244,19566,5532,5338,5323,2584,593,1766,6836,17783,2661,5194,6077,6456,19567,12976,4317,1844,6702,2088,13493,13334,3288,5363,1775,15077,5498,1352,1822,3287,422,3216,1870,6573,4906,4699,13593,6172,16399,4234,1548,1420,4281,3290,856,4293,3828,16368,18247,6395,18488,2228,4943,4184,1425,13528,6574,6177,2049,2119,5669,2333,6577,590,7718,1429,5429,4478,6572,17389,3170,2536,18246,5454,589,3285,1941,5723,3162,1869,2651,1738,6578,1778,585,6542,5710,3526,12974,2996,3963,19400,1413,5322,2400,1745,2402,1960,2235,17951,2292,6262,6617,12624,3397,3188,2239,15144,1719,3414,6396,4034,2547,1390,6478,645,3187,2660,2826,2142,5485,2467,1424,5102,1439,1929,2582,13002,6535,5662,5609,5264,5252,2090,1821,4395,3964,1954,1899,6039,2108,594,4199,1554,2575,6245,6557,2212,1428,6571,15803,6131,4033,13727,3289,12579,6146,15681,5364,4230,1959,6111,2172,13428,6109,12975,1443,3691,6543,1422,6509,7520,2419,586,2236,2831,4701,13032,6002,5330,18080,18575,583,3044,1391,1932,2215,895,4698,1855,12622,2653,3039,792,5365,18614,5517}'::integer[]))
12. 0.000 0.000 ↓ 0.0

Index Scan using client_companies_index_agent_id on client_companies (cost=0.42..10.38 rows=85 width=4) (actual rows= loops=)

  • Index Cond: (agent_id = agents.id)
  • Filter: ((NOT inactive) AND (ma_company_id = 75))