explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hdcV

Settings
# exclusive inclusive rows x rows loops node
1. 1.733 774.796 ↓ 2,637.0 2,637 1

GroupAggregate (cost=125,006.76..125,006.80 rows=1 width=87) (actual time=772.966..774.796 rows=2,637 loops=1)

  • Group Key: stats_adrevenue.date, stats_adrevenue.country, core_adrevenue_app_map.app_id, core_app.customer_id, core_connectedchannel.channel_id, stats_adrevenue.ad_unit_map_id
2. 4.168 773.063 ↓ 2,637.0 2,637 1

Sort (cost=125,006.76..125,006.76 rows=1 width=43) (actual time=772.952..773.063 rows=2,637 loops=1)

  • Sort Key: stats_adrevenue.date, stats_adrevenue.country, core_app.customer_id, stats_adrevenue.ad_unit_map_id
  • Sort Method: quicksort Memory: 453kB
3. 0.704 768.895 ↓ 2,637.0 2,637 1

Nested Loop Left Join (cost=1,001.13..125,006.75 rows=1 width=43) (actual time=23.499..768.895 rows=2,637 loops=1)

  • Join Filter: ((core_app.id = app_id) AND (stats_adrevenue.date = date) AND ((stats_adrevenue.country)::text = (country)::text))
4. 1.157 768.191 ↓ 2,637.0 2,637 1

Nested Loop (cost=1,001.13..125,006.71 rows=1 width=43) (actual time=23.495..768.191 rows=2,637 loops=1)

5. 1.644 764.397 ↓ 2,637.0 2,637 1

Gather (cost=1,000.85..125,002.40 rows=1 width=35) (actual time=23.485..764.397 rows=2,637 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
6. 44.373 762.753 ↓ 1,318.0 1,318 2 / 2

Nested Loop (cost=0.85..124,002.30 rows=1 width=35) (actual time=394.394..762.753 rows=1,318 loops=2)

7. 13.086 589.422 ↓ 1,083.7 128,958 2 / 2

Nested Loop (cost=0.57..123,966.22 rows=119 width=35) (actual time=111.412..589.422 rows=128,958 loops=2)

8. 2.214 2.214 ↑ 1.0 2 2 / 2

Parallel Seq Scan on core_connectedchannel (cost=0.00..2,391.76 rows=2 width=8) (actual time=0.551..2.214 rows=2 loops=2)

  • Filter: (channel_id = 259)
  • Rows Removed by Filter: 5,724
9. 574.122 574.122 ↓ 2.3 51,583 5 / 2

Index Scan using stats_adrevenue_date_app_map_id_connecte_6b5281f1_uniq on stats_adrevenue (cost=0.57..60,565.68 rows=22,155 width=35) (actual time=62.795..229.649 rows=51,583 loops=5)

  • Index Cond: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date) AND (connected_channel_id = core_connectedchannel.id))
10. 128.959 128.959 ↓ 0.0 0 257,917 / 2

Index Scan using core_adrevenue_app_map_pkey on core_adrevenue_app_map (cost=0.28..0.30 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=257,917)

  • Index Cond: (id = stats_adrevenue.app_map_id)
  • Filter: (app_id = 4,169)
  • Rows Removed by Filter: 1
11. 2.637 2.637 ↑ 1.0 1 2,637

Index Scan using core_app_pkey on core_app (cost=0.28..4.30 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=2,637)

  • Index Cond: (id = 4,169)
12. 0.000 0.000 ↓ 0.0 0 2,637

HashAggregate (cost=0.00..0.01 rows=1 width=24) (actual time=0.000..0.000 rows=0 loops=2,637)

  • Group Key: date, app_id, country
13. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=0) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: false
Planning time : 1.964 ms
Execution time : 775.022 ms