explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WixN

Settings
# exclusive inclusive rows x rows loops node
1. 15,673.722 19,507.816 ↓ 1.3 16,000,000 1

Hash Join (cost=53,624.79..723,544.79 rows=12,000,000 width=89) (actual time=306.146..19,507.816 rows=16,000,000 loops=1)

  • Output: uf.subtype, uf.price, (e.payload ->> 'amount'::text), (uf.price * ((e.payload ->> 'amount'::text))::numeric), e.id
  • Hash Cond: (e.type = uf.event_type)
2. 3,527.985 3,527.985 ↑ 1.0 12,000,000 1

Seq Scan on public.events e (cost=0.00..354,920.00 rows=12,000,000 width=79) (actual time=0.012..3,527.985 rows=12,000,000 loops=1)

  • Output: e.id, e.type, e.payload, e.created_at
  • Filter: ((e.created_at >= '2020-01-01 00:00:00'::timestamp without time zone) AND (e.created_at <= '2020-02-01 00:00:00'::timestamp without time zone))
3. 0.018 306.109 ↑ 1.9 8 1

Hash (cost=53,624.60..53,624.60 rows=15 width=26) (actual time=306.109..306.109 rows=8 loops=1)

  • Output: uf.subtype, uf.price, uf.event_type
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
4. 0.006 306.091 ↑ 1.9 8 1

Subquery Scan on uf (cost=0.42..53,624.60 rows=15 width=26) (actual time=0.011..306.091 rows=8 loops=1)

  • Output: uf.subtype, uf.price, uf.event_type
5. 58.476 306.085 ↑ 1.9 8 1

Unique (cost=0.42..53,624.45 rows=15 width=26) (actual time=0.011..306.085 rows=8 loops=1)

  • Output: fee.price, fee.event_type, fee.subtype
6. 247.609 247.609 ↑ 1.0 458,786 1

Index Scan Backward using idx_fee_sorted_cmpx_event_type_subtype on public.fee (cost=0.42..51,330.52 rows=458,787 width=26) (actual time=0.009..247.609 rows=458,786 loops=1)

  • Output: fee.price, fee.event_type, fee.subtype
  • Filter: ((fee.created_at >= '2020-01-01 00:00:00'::timestamp without time zone) AND (fee.created_at <= '2020-02-01 00:00:00'::timestamp without time zone) AND (fee.domain = 'customer'::feedomainenum))
  • Rows Removed by Filter: 1
Planning time : 0.283 ms
Execution time : 20,148.660 ms