explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 76Ow

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

Unique (cost=2,376,496.67..2,436,602.33 rows=4,808,453 width=43) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=2,376,496.67..2,388,517.80 rows=4,808,453 width=43) (actual rows= loops=)

  • Sort Key: cud.user_id, (to_date(to_char(to_timestamp((cud.date)::double precision), 'YYYY-MM'::text), 'YYYY-MM'::text)), cud.brand_id, (to_date(to_char(to_timestamp(((min(cud_1.date)))::double precision), 'YYYY-MM'::text), 'YYYY-MM'::text))
3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,024,063.69..1,694,910.11 rows=4,808,453 width=43) (actual rows= loops=)

  • Hash Cond: (((cud.user_id)::text = (cud_1.user_id)::text) AND (cud.brand_id = cud_1.brand_id))
4. 0.000 0.000 ↓ 0.0

Seq Scan on b_crm_users_deposit cud (cost=0.00..464,488.98 rows=4,808,453 width=39) (actual rows= loops=)

  • Filter: ((paymethod IS NOT NULL) AND (brand_id <> 22) AND (status = 2))
5. 0.000 0.000 ↓ 0.0

Hash (cost=995,419.07..995,419.07 rows=1,255,641 width=39) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Finalize GroupAggregate (cost=627,503.09..982,862.66 rows=1,255,641 width=39) (actual rows= loops=)

  • Group Key: cud_1.user_id, cud_1.brand_id
7. 0.000 0.000 ↓ 0.0

Gather Merge (cost=627,503.09..951,471.64 rows=2,511,282 width=39) (actual rows= loops=)

  • Workers Planned: 2
8. 0.000 0.000 ↓ 0.0

Partial GroupAggregate (cost=626,503.07..660,607.36 rows=1,255,641 width=39) (actual rows= loops=)

  • Group Key: cud_1.user_id, cud_1.brand_id
9. 0.000 0.000 ↓ 0.0

Sort (cost=626,503.07..631,890.04 rows=2,154,788 width=39) (actual rows= loops=)

  • Sort Key: cud_1.user_id, cud_1.brand_id
10. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on b_crm_users_deposit cud_1 (cost=0.00..340,906.41 rows=2,154,788 width=39) (actual rows= loops=)

  • Filter: ((paymethod IS NOT NULL) AND (status = 2))