explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Siyl

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 3,018.002 ↑ 3,992.8 8 1

Finalize GroupAggregate (cost=147,853.14..153,301.19 rows=31,942 width=124) (actual time=2,992.366..3,018.002 rows=8 loops=1)

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

Gather Merge (cost=147,853.14..151,424.61 rows=26,618 width=128) (actual time=2,987.769..3,018.016 rows=8 loops=1)

  • Workers Planned: 2
  • Workers Launched: 0
3. 23.627 3,017.380 ↑ 1,663.6 8 1

Partial GroupAggregate (cost=146,853.12..147,352.21 rows=13,309 width=128) (actual time=2,987.246..3,017.380 rows=8 loops=1)

  • Group Key: (date_trunc('day'::text, gamepay_orders.updated_at))
4. 43.544 2,993.753 ↓ 6.4 85,723 1

Sort (cost=146,853.12..146,886.39 rows=13,309 width=22) (actual time=2,981.540..2,993.753 rows=85,723 loops=1)

  • Sort Key: (date_trunc('day'::text, gamepay_orders.updated_at))
  • Sort Method: quicksort Memory: 9770kB
5. 47.538 2,950.209 ↓ 6.4 85,723 1

Hash Semi Join (cost=67.41..145,941.44 rows=13,309 width=22) (actual time=0.466..2,950.209 rows=85,723 loops=1)

  • Hash Cond: (users.registration_country_id = "ANY_subquery".id)
6. 12.797 2,902.324 ↓ 6.4 85,723 1

Nested Loop (cost=0.87..145,658.63 rows=13,309 width=18) (actual time=0.093..2,902.324 rows=85,723 loops=1)

7. 489.283 489.283 ↓ 6.4 85,723 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.073..489.283 rows=85,723 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: 22470
8. 2,400.244 2,400.244 ↑ 1.0 1 85,723

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

  • Index Cond: (id = gamepay_orders.user_id)
  • Heap Fetches: 46120
9. 0.033 0.347 ↑ 1.0 248 1

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

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

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

11. 0.153 0.289 ↑ 1.0 248 1

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

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

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

Planning time : 5.074 ms
Execution time : 3,018.259 ms