explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ebxu

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 791.747 ↑ 3,992.8 8 1

Finalize GroupAggregate (cost=147,896.23..153,344.28 rows=31,942 width=124) (actual time=760.905..791.747 rows=8 loops=1)

  • Group Key: (date_trunc('day'::text, gamepay_orders.updated_at))
2. 0.621 791.742 ↑ 3,327.2 8 1

Gather Merge (cost=147,896.23..151,467.69 rows=26,618 width=128) (actual time=755.674..791.742 rows=8 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
3. 27.886 791.121 ↑ 1,663.6 8 1

Partial GroupAggregate (cost=146,896.20..147,395.29 rows=13,309 width=128) (actual time=755.176..791.121 rows=8 loops=1)

  • Group Key: (date_trunc('day'::text, gamepay_orders.updated_at))
4. 37.255 763.235 ↓ 6.4 85,741 1

Sort (cost=146,896.20..146,929.47 rows=13,309 width=22) (actual time=749.599..763.235 rows=85,741 loops=1)

  • Sort Key: (date_trunc('day'::text, gamepay_orders.updated_at))
  • Sort Method: quicksort Memory: 9771kB
5. 33.972 725.980 ↓ 6.4 85,741 1

Hash Semi Join (cost=67.41..145,984.53 rows=13,309 width=22) (actual time=0.429..725.980 rows=85,741 loops=1)

  • Hash Cond: (users.registration_country_id = "ANY_subquery".id)
6. 18.935 691.684 ↓ 6.4 85,741 1

Nested Loop (cost=0.87..145,701.71 rows=13,309 width=18) (actual time=0.093..691.684 rows=85,741 loops=1)

7. 415.526 415.526 ↓ 6.4 85,741 1

Parallel Index Scan using idx_gamepay_orders_on_updated_at_202002_temp4 on gamepay_orders (cost=0.43..126,263.41 rows=13,309 width=18) (actual time=0.074..415.526 rows=85,741 loops=1)

  • Index Cond: (((updated_at)::date >= '2020-02-05'::date) AND ((updated_at)::date <= '2020-02-12'::date))
  • Filter: ((NOT fraud) AND (amount > 0))
  • Rows Removed by Filter: 22473
8. 257.223 257.223 ↑ 1.0 1 85,741

Index Only Scan using idx_users_13032019_01 on users (cost=0.44..1.46 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=85,741)

  • Index Cond: (id = gamepay_orders.user_id)
  • Heap Fetches: 42782
9. 0.030 0.324 ↑ 1.0 248 1

Hash (cost=63.44..63.44 rows=248 width=4) (actual time=0.324..0.324 rows=248 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
10. 0.025 0.294 ↑ 1.0 248 1

Subquery Scan on ANY_subquery (cost=60.34..63.44 rows=248 width=4) (actual time=0.257..0.294 rows=248 loops=1)

11. 0.134 0.269 ↑ 1.0 248 1

Sort (cost=60.34..60.96 rows=248 width=7) (actual time=0.256..0.269 rows=248 loops=1)

  • Sort Key: countries.iso
  • Sort Method: quicksort Memory: 36kB
12. 0.135 0.135 ↑ 1.0 248 1

Seq Scan on countries (cost=0.00..50.48 rows=248 width=7) (actual time=0.004..0.135 rows=248 loops=1)

Planning time : 2.633 ms
Execution time : 791.970 ms