explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IWLf

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=115.78..116.28 rows=200 width=48) (actual rows= loops=)

  • Sort Key: t.user_id
2. 0.000 0.000 ↓ 0.0

HashAggregate (cost=106.14..108.14 rows=200 width=48) (actual rows= loops=)

  • Group Key: t.user_id, t.user_data_2
3. 0.000 0.000 ↓ 0.0

Subquery Scan on t (cost=67.15..97.26 rows=444 width=72) (actual rows= loops=)

  • Filter: (CASE WHEN ((t.percent_diff IS NULL) AND (t.week_diff IS NULL) AND (t.transaction_amount >= '200'::double precision)) THEN t.transaction_timestamp WHEN ((t.percent_diff <= '0.25'::double precision) AND (t.week_diff = '1'::double precision)) THEN t.transaction_timestamp WHEN ((t.percent_diff <= '0.25'::double precision) AND (t.week_diff = '2'::double precision)) THEN t.transaction_timestamp ELSE NULL::timestamp without time zone END IS NOT NULL)
4. 0.000 0.000 ↓ 0.0

WindowAgg (cost=67.15..87.22 rows=446 width=80) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Sort (cost=67.15..68.27 rows=446 width=64) (actual rows= loops=)

  • Sort Key: direct_deposit.user_id, direct_deposit.transaction_timestamp DESC
6. 0.000 0.000 ↓ 0.0

WindowAgg (cost=36.38..47.53 rows=446 width=64) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Sort (cost=36.38..37.49 rows=446 width=56) (actual rows= loops=)

  • Sort Key: direct_deposit.user_id, direct_deposit.user_data_2, direct_deposit.transaction_amount, direct_deposit.transaction_timestamp DESC
8. 0.000 0.000 ↓ 0.0

Seq Scan on direct_deposit (cost=0.00..16.75 rows=446 width=56) (actual rows= loops=)

  • Filter: ((dd_type <> 'trial deposit'::text) AND (dd_type <> 'tax'::text))