explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uflH

Settings
# exclusive inclusive rows x rows loops node
1. 0.108 7.052 ↑ 1,526.8 82 1

GroupAggregate (cost=4,667.44..11,176.99 rows=125,201 width=184) (actual time=6.958..7.052 rows=82 loops=1)

  • Group Key: db_agents.agent_name, (date_trunc('quarter'::text, recording_agents.recording_date)), recording_agents.spotting_type, recording_agents.set_name, recording_agents.group_name, recording_agents.keyword
  • Group Key: db_agents.agent_name, (date_trunc('quarter'::text, recording_agents.recording_date)), recording_agents.spotting_type, recording_agents.set_name, recording_agents.group_name
  • Group Key: db_agents.agent_name, (date_trunc('quarter'::text, recording_agents.recording_date)), recording_agents.spotting_type, recording_agents.set_name
  • Group Key: db_agents.agent_name, (date_trunc('quarter'::text, recording_agents.recording_date)), recording_agents.spotting_type
  • Group Key: db_agents.agent_name, (date_trunc('quarter'::text, recording_agents.recording_date))
  • Group Key: db_agents.agent_name
  • Group Key: ()
2. 0.032 6.944 ↑ 806.5 31 1

Sort (cost=4,667.44..4,729.94 rows=25,000 width=176) (actual time=6.942..6.944 rows=31 loops=1)

  • Sort Key: db_agents.agent_name, (date_trunc('quarter'::text, recording_agents.recording_date)), recording_agents.spotting_type, recording_agents.set_name, recording_agents.group_name, recording_agents.keyword
  • Sort Method: quicksort Memory: 29kB
3. 0.017 6.912 ↑ 806.5 31 1

Merge Join (cost=180.24..702.74 rows=25,000 width=176) (actual time=6.878..6.912 rows=31 loops=1)

  • Merge Cond: (filtered_agents.agent_id = recording_agents.agent_id)
4. 0.004 0.038 ↑ 500.0 2 1

Sort (cost=60.08..62.58 rows=1,000 width=4) (actual time=0.037..0.038 rows=2 loops=1)

  • Sort Key: filtered_agents.agent_id
  • Sort Method: quicksort Memory: 25kB
5. 0.034 0.034 ↑ 500.0 2 1

Function Scan on akm_get_filtered_agents_by_agents filtered_agents (cost=0.25..10.25 rows=1,000 width=4) (actual time=0.034..0.034 rows=2 loops=1)

6. 0.009 6.857 ↑ 161.3 31 1

Materialize (cost=120.16..212.66 rows=5,000 width=184) (actual time=6.836..6.857 rows=31 loops=1)

7. 0.015 6.848 ↑ 161.3 31 1

Merge Join (cost=120.16..200.16 rows=5,000 width=184) (actual time=6.834..6.848 rows=31 loops=1)

  • Merge Cond: (recording_agents.agent_id = db_agents.agent_id)
8. 0.013 6.174 ↑ 31.2 32 1

Sort (cost=60.08..62.58 rows=1,000 width=148) (actual time=6.172..6.174 rows=32 loops=1)

  • Sort Key: recording_agents.agent_id
  • Sort Method: quicksort Memory: 29kB
9. 6.161 6.161 ↑ 31.2 32 1

Function Scan on get_advanced_keyword_agent_ids recording_agents (cost=0.25..10.25 rows=1,000 width=148) (actual time=6.157..6.161 rows=32 loops=1)

10. 0.007 0.659 ↑ 26.3 38 1

Sort (cost=60.08..62.58 rows=1,000 width=36) (actual time=0.658..0.659 rows=38 loops=1)

  • Sort Key: db_agents.agent_id
  • Sort Method: quicksort Memory: 25kB
11. 0.652 0.652 ↑ 100.0 10 1

Function Scan on akm_get_location_manager_agents db_agents (cost=0.25..10.25 rows=1,000 width=36) (actual time=0.651..0.652 rows=10 loops=1)

Planning time : 0.184 ms
Execution time : 7.119 ms