explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Fp5O

Settings
# exclusive inclusive rows x rows loops node
1. 11.998 8,160.893 ↓ 8.0 18,422 1

GroupAggregate (cost=3,192,211.70..3,192,309.92 rows=2,311 width=87) (actual time=8,148.060..8,160.893 rows=18,422 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. 34.317 8,148.895 ↓ 8.0 18,480 1

Sort (cost=3,192,211.70..3,192,217.48 rows=2,311 width=43) (actual time=8,148.045..8,148.895 rows=18,480 loops=1)

  • Sort Key: stats_adrevenue.date, stats_adrevenue.country, core_app.customer_id, core_connectedchannel.channel_id, stats_adrevenue.ad_unit_map_id
  • Sort Method: quicksort Memory: 2,245kB
3. 5.575 8,114.578 ↓ 8.0 18,480 1

Hash Left Join (cost=2,768,204.52..3,192,082.58 rows=2,311 width=43) (actual time=3,620.954..8,114.578 rows=18,480 loops=1)

  • Hash Cond: ((core_app.id = sq0.app_id) AND (stats_adrevenue.date = sq0.date) AND ((stats_adrevenue.country)::text = (sq0.country)::text))
4. 6.127 5,539.391 ↓ 8.0 18,480 1

Nested Loop (cost=16,495.81..440,355.67 rows=2,311 width=43) (actual time=1,051.325..5,539.391 rows=18,480 loops=1)

5. 2.079 5,514.784 ↓ 8.0 18,480 1

Nested Loop (cost=16,495.52..439,637.83 rows=2,311 width=43) (actual time=1,051.308..5,514.784 rows=18,480 loops=1)

6. 0.040 0.205 ↑ 1.0 25 1

Nested Loop (cost=0.56..45.33 rows=26 width=16) (actual time=0.024..0.205 rows=25 loops=1)

7. 0.010 0.010 ↑ 1.0 1 1

Index Scan using core_app_pkey on core_app (cost=0.28..4.30 rows=1 width=8) (actual time=0.009..0.010 rows=1 loops=1)

  • Index Cond: (id = 4,169)
8. 0.155 0.155 ↑ 1.0 25 1

Index Scan using core_adrevenue_app_map_app_id_a0995552 on core_adrevenue_app_map (cost=0.28..40.77 rows=26 width=8) (actual time=0.013..0.155 rows=25 loops=1)

  • Index Cond: (app_id = 4,169)
9. 35.500 5,512.500 ↓ 3.6 739 25

Bitmap Heap Scan on stats_adrevenue (cost=16,494.96..16,905.36 rows=204 width=35) (actual time=219.659..220.500 rows=739 loops=25)

  • Recheck Cond: ((app_map_id = core_adrevenue_app_map.id) AND (date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
  • Heap Blocks: exact=5,496
10. 31.275 5,477.000 ↓ 0.0 0 25

BitmapAnd (cost=16,494.96..16,494.96 rows=204 width=0) (actual time=219.080..219.080 rows=0 loops=25)

11. 248.025 248.025 ↓ 1.3 107,754 25

Bitmap Index Scan on stats_adrevenue_app_map_id_54a34d1e (cost=0.00..2,217.24 rows=84,500 width=0) (actual time=9.921..9.921 rows=107,754 loops=25)

  • Index Cond: (app_map_id = core_adrevenue_app_map.id)
12. 5,197.700 5,197.700 ↓ 7.0 4,168,735 25

Bitmap Index Scan on stats_adrevenue_date_9c7168e0 (cost=0.00..14,129.25 rows=592,668 width=0) (actual time=207.908..207.908 rows=4,168,735 loops=25)

  • Index Cond: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
13. 18.480 18.480 ↑ 1.0 1 18,480

Index Scan using core_connectedchannel_pkey on core_connectedchannel (cost=0.29..0.31 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=18,480)

  • Index Cond: (id = stats_adrevenue.connected_channel_id)
14. 0.096 2,569.612 ↑ 4.1 474 1

Hash (cost=2,751,674.54..2,751,674.54 rows=1,953 width=14) (actual time=2,569.612..2,569.612 rows=474 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 39kB
15. 0.044 2,569.516 ↑ 4.1 474 1

Subquery Scan on sq0 (cost=2,750,541.45..2,751,674.54 rows=1,953 width=14) (actual time=2,567.771..2,569.516 rows=474 loops=1)

16. 0.000 2,569.472 ↑ 4.1 474 1

Finalize GroupAggregate (cost=2,750,541.45..2,751,655.01 rows=1,953 width=14) (actual time=2,567.769..2,569.472 rows=474 loops=1)

  • Group Key: stats_general_regular.date, stats_general_regular.app_id, stats_general_regular.country
17. 28.642 2,591.742 ↑ 3.6 2,172 1

Gather Merge (cost=2,750,541.45..2,751,552.48 rows=7,812 width=18) (actual time=2,567.758..2,591.742 rows=2,172 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
18. 0.427 2,563.100 ↑ 4.5 434 5 / 5

Partial GroupAggregate (cost=2,749,541.39..2,749,621.93 rows=1,953 width=18) (actual time=2,562.565..2,563.100 rows=434 loops=5)

  • Group Key: stats_general_regular.date, stats_general_regular.app_id, stats_general_regular.country
19. 2.385 2,562.673 ↑ 1.8 2,690 5 / 5

Sort (cost=2,749,541.39..2,749,553.59 rows=4,881 width=18) (actual time=2,562.555..2,562.673 rows=2,690 loops=5)

  • Sort Key: stats_general_regular.date, stats_general_regular.country
  • Sort Method: quicksort Memory: 321kB
  • Worker 0: Sort Method: quicksort Memory: 289kB
  • Worker 1: Sort Method: quicksort Memory: 290kB
  • Worker 2: Sort Method: quicksort Memory: 306kB
  • Worker 3: Sort Method: quicksort Memory: 328kB
20. 0.162 2,560.288 ↑ 1.8 2,690 5 / 5

Parallel Append (cost=0.56..2,749,242.36 rows=4,881 width=18) (actual time=2,298.829..2,560.288 rows=2,690 loops=5)

21. 2,491.147 2,560.088 ↑ 1.8 2,690 5 / 5

Parallel Bitmap Heap Scan on stats_general_regular (cost=31,199.95..2,740,170.29 rows=4,878 width=18) (actual time=2,298.790..2,560.088 rows=2,690 loops=5)

  • Recheck Cond: (app_id = 4,169)
  • Filter: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
  • Rows Removed by Filter: 312,603
  • Heap Blocks: exact=181,182
22. 68.941 68.941 ↓ 1.0 1,692,042 1 / 5

Bitmap Index Scan on stats_general_regular_app_idx (cost=0.00..31,195.07 rows=1,611,533 width=0) (actual time=344.707..344.707 rows=1,692,042 loops=1)

  • Index Cond: (app_id = 4,169)
23. 0.025 0.029 ↓ 0.0 0 1 / 5

Parallel Bitmap Heap Scan on stats_general_important_zeptolab (cost=217.01..219.02 rows=1 width=18) (actual time=0.146..0.146 rows=0 loops=1)

  • Recheck Cond: ((app_id = 4,169) AND (date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
24. 0.000 0.004 ↓ 0.0 0 1 / 5

BitmapAnd (cost=217.01..217.01 rows=1 width=0) (actual time=0.019..0.019 rows=0 loops=1)

25. 0.004 0.004 ↓ 0.0 0 1 / 5

Bitmap Index Scan on stats_general_important_zepto_app_idx (cost=0.00..23.95 rows=1,269 width=0) (actual time=0.019..0.019 rows=0 loops=1)

  • Index Cond: (app_id = 4,169)
26. 0.000 0.000 ↓ 0.0 0 / 5

Bitmap Index Scan on stats_general_important_zepto_unique (cost=0.00..192.81 rows=9,625 width=0) (never executed)

  • Index Cond: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
27. 0.001 0.001 ↓ 0.0 0 1 / 5

Parallel Index Scan using stats_general_important_smartnews_app_idx on stats_general_important_smartnews (cost=0.56..4.30 rows=1 width=18) (actual time=0.005..0.006 rows=0 loops=1)

  • Index Cond: (app_id = 4,169)
  • Filter: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
28. 0.001 0.001 ↓ 0.0 0 1 / 5

Parallel Index Scan using stats_general_important_slc_app_idx on stats_general_important_super_lucky_casino (cost=0.56..7,700.57 rows=5 width=18) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (app_id = 4,169)
  • Filter: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
29. 0.002 0.002 ↓ 0.0 0 1 / 5

Parallel Index Scan using stats_general_important_melsoft_app_idx on stats_general_important_melsoft (cost=0.56..4.14 rows=1 width=18) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: (app_id = 4,169)
  • Filter: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
30. 0.002 0.002 ↓ 0.0 0 1 / 5

Parallel Index Scan using stats_general_important_hutch_app_idx on stats_general_important_hutchgames (cost=0.56..1,100.15 rows=2 width=18) (actual time=0.009..0.009 rows=0 loops=1)

  • Index Cond: (app_id = 4,169)
  • Filter: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
31. 0.000 0.000 ↓ 0.0 0 1 / 5

Parallel Index Scan using stats_general_important_zynga_app_idx on stats_general_important_zynga (cost=0.14..4.15 rows=1 width=28) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (app_id = 4,169)
  • Filter: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
32. 0.001 0.001 ↓ 0.0 0 1 / 5

Parallel Index Scan using stats_general_important_playtika_app_idx on stats_general_important_playtika (cost=0.14..4.15 rows=1 width=28) (actual time=0.003..0.003 rows=0 loops=1)

  • Index Cond: (app_id = 4,169)
  • Filter: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
33. 0.000 0.000 ↓ 0.0 0 1 / 5

Parallel Index Scan using stats_general_important_pixonic_unique on stats_general_important_pixonic (cost=0.12..4.14 rows=1 width=18) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
  • Filter: (app_id = 4,169)
34. 0.000 0.000 ↓ 0.0 0 1 / 5

Parallel Index Scan using stats_general_important_moburst_app_idx on stats_general_important_moburst (cost=0.12..4.14 rows=1 width=18) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (app_id = 4,169)
  • Filter: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
35. 0.001 0.001 ↓ 0.0 0 1 / 5

Parallel Index Scan using stats_general_important_dataduck_app_idx on stats_general_important_dataduck (cost=0.12..2.90 rows=1 width=18) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: (app_id = 4,169)
  • Filter: ((date >= '2020-07-26'::date) AND (date <= '2020-07-27'::date))
Planning time : 2.228 ms
Execution time : 8,184.378 ms