explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YD5e

Settings
# exclusive inclusive rows x rows loops node
1. 0.083 141.402 ↑ 1.0 100 1

Limit (cost=112,855.27..2,970,820.56 rows=100 width=80) (actual time=3.921..141.402 rows=100 loops=1)

2. 0.890 141.319 ↑ 2,940.7 100 1

GroupAggregate (cost=112,855.27..8,404,388,486.34 rows=294,065 width=80) (actual time=3.920..141.319 rows=100 loops=1)

  • Group Key: round_ups.user_id
3. 15.353 140.429 ↑ 83,837.0 507 1

Merge Join (cost=112,855.27..8,403,640,231.72 rows=42,505,351 width=37) (actual time=3.702..140.429 rows=507 loops=1)

  • Merge Cond: (round_up_profiles.user_id = round_ups.user_id)
  • Join Filter: (round_ups.manual OR (round_up_profiles.round_ups_enabled AND (NOT COALESCE(round_ups.instant, false)) AND (round_up_accounts.start_date <= round_ups.transaction_date) AND (date_part('day'::text, (round_ups.created_at - round_ups.transaction_date)) <= '7'::double precision)))
  • Rows Removed by Join Filter: 34316
4. 0.989 0.989 ↑ 15,743.9 618 1

Index Scan using round_up_profiles_pkey on round_up_profiles (cost=0.43..22,346,238.04 rows=9,729,736 width=22) (actual time=0.008..0.989 rows=618 loops=1)

5. 29.350 124.087 ↑ 5,726.2 34,823 1

Materialize (cost=1,001.29..8,376,894,918.33 rows=199,404,647 width=54) (actual time=3.683..124.087 rows=34,823 loops=1)

6. 0.000 94.737 ↑ 5,726.2 34,823 1

Gather Merge (cost=1,001.29..8,376,396,406.71 rows=199,404,647 width=54) (actual time=3.680..94.737 rows=34,823 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 50.267 258.981 ↑ 7,131.2 11,651 3

Nested Loop (cost=1.27..8,353,379,162.70 rows=83,085,270 width=54) (actual time=0.044..86.327 rows=11,651 loops=3)

8. 138.048 138.048 ↑ 7,054.3 11,778 3

Parallel Index Scan using index_round_ups_on_user_id on round_ups (cost=0.70..7,931,175,317.86 rows=83,085,270 width=66) (actual time=0.024..46.016 rows=11,778 loops=3)

  • Filter: (((state)::text = 'pending'::text) AND (manual OR ((NOT COALESCE(instant, false)) AND (date_part('day'::text, (created_at - transaction_date)) <= '7'::double precision))))
  • Rows Removed by Filter: 39130
9. 70.666 70.666 ↑ 1.0 1 35,333

Index Scan using round_up_accounts_pkey on round_up_accounts (cost=0.56..5.08 rows=1 width=20) (actual time=0.002..0.002 rows=1 loops=35,333)

  • Index Cond: (linked_subaccount_id = round_ups.linked_subaccount_id)
Planning time : 0.733 ms
Execution time : 143.718 ms