explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tr8Z

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 153,188.340 ↑ 3,992.6 8 1

Finalize GroupAggregate (cost=4,019,918.52..4,025,366.53 rows=31,941 width=124) (actual time=153,170.912..153,188.340 rows=8 loops=1)

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

Gather Merge (cost=4,019,918.52..4,023,489.99 rows=26,618 width=128) (actual time=153,167.549..153,188.364 rows=8 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
3. 19.943 153,187.580 ↑ 1,663.6 8 1

Partial GroupAggregate (cost=4,018,918.50..4,019,417.59 rows=13,309 width=128) (actual time=153,166.863..153,187.580 rows=8 loops=1)

  • Group Key: (date_trunc('day'::text, gamepay_orders.updated_at))
4. 40.983 153,167.637 ↓ 6.4 85,528 1

Sort (cost=4,018,918.50..4,018,951.77 rows=13,309 width=22) (actual time=153,163.324..153,167.637 rows=85,528 loops=1)

  • Sort Key: (date_trunc('day'::text, gamepay_orders.updated_at))
  • Sort Method: quicksort Memory: 9,754kB
5. 62.886 153,126.654 ↓ 6.4 85,528 1

Hash Semi Join (cost=67.41..4,018,006.82 rows=13,309 width=22) (actual time=147,066.820..153,126.654 rows=85,528 loops=1)

  • Hash Cond: (users.registration_country_id = "ANY_subquery".id)
6. 41.176 153,063.253 ↓ 6.4 85,528 1

Nested Loop (cost=0.87..4,017,724.01 rows=13,309 width=18) (actual time=147,064.159..153,063.253 rows=85,528 loops=1)

7. 147,377.229 147,377.229 ↓ 6.4 85,528 1

Parallel Index Scan using index_gamepay_orders_on_updated_at on gamepay_orders (cost=0.43..3,995,074.60 rows=13,309 width=18) (actual time=147,064.128..147,377.229 rows=85,528 loops=1)

  • Filter: ((amount > 0) AND ((updated_at)::date >= '2020-02-05'::date) AND ((updated_at)::date <= '2020-02-12'::date))
  • Rows Removed by Filter: 6,809,943
8. 5,644.848 5,644.848 ↑ 1.0 1 85,528

Index Only Scan using idx_users_13032019_01 on users (cost=0.44..1.70 rows=1 width=8) (actual time=0.066..0.066 rows=1 loops=85,528)

  • Index Cond: (id = gamepay_orders.user_id)
  • Heap Fetches: 75,266
9. 0.038 0.515 ↑ 1.0 248 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
10. 0.026 0.477 ↑ 1.0 248 1

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

11. 0.260 0.451 ↑ 1.0 248 1

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

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

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

Planning time : 5.386 ms
Execution time : 153,188.641 ms