explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TNc4

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 79,783.025 ↑ 3,992.0 8 1

Finalize GroupAggregate (cost=4,019,609.55..4,025,056.73 rows=31,936 width=124) (actual time=79,761.839..79,783.025 rows=8 loops=1)

  • Group Key: (date_trunc('day'::text, gamepay_orders.updated_at))
2. 0.635 79,783.042 ↑ 3,326.8 8 1

Gather Merge (cost=4,019,609.55..4,023,180.48 rows=26,614 width=128) (actual time=79,758.264..79,783.042 rows=8 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
3. 23.424 79,782.407 ↑ 1,663.4 8 1

Partial GroupAggregate (cost=4,018,609.53..4,019,108.54 rows=13,307 width=128) (actual time=79,757.775..79,782.407 rows=8 loops=1)

  • Group Key: (date_trunc('day'::text, gamepay_orders.updated_at))
4. 47.064 79,758.983 ↓ 6.4 84,648 1

Sort (cost=4,018,609.53..4,018,642.79 rows=13,307 width=22) (actual time=79,753.386..79,758.983 rows=84,648 loops=1)

  • Sort Key: (date_trunc('day'::text, gamepay_orders.updated_at))
  • Sort Method: quicksort Memory: 9686kB
5. 62.775 79,711.919 ↓ 6.4 84,648 1

Hash Semi Join (cost=67.41..4,017,698.00 rows=13,307 width=22) (actual time=73,162.693..79,711.919 rows=84,648 loops=1)

  • Hash Cond: (users.registration_country_id = "ANY_subquery".id)
6. 31.397 79,646.560 ↓ 6.4 84,648 1

Nested Loop (cost=0.87..4,017,415.22 rows=13,307 width=18) (actual time=73,160.070..79,646.560 rows=84,648 loops=1)

7. 73,689.803 73,689.803 ↓ 6.4 84,648 1

Parallel Index Scan using index_gamepay_orders_on_updated_at on gamepay_orders (cost=0.43..3,994,774.87 rows=13,307 width=18) (actual time=73,159.785..73,689.803 rows=84,648 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: 6809773
8. 5,925.360 5,925.360 ↑ 1.0 1 84,648

Index Only Scan using idx_users_13032019_01 on users (cost=0.44..1.70 rows=1 width=8) (actual time=0.070..0.070 rows=1 loops=84,648)

  • Index Cond: (id = gamepay_orders.user_id)
  • Heap Fetches: 93908
9. 0.044 2.584 ↑ 1.0 248 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
10. 0.029 2.540 ↑ 1.0 248 1

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

11. 2.204 2.511 ↑ 1.0 248 1

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

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

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

Planning time : 2.218 ms
Execution time : 79,783.326 ms