explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LBqZ

Settings
# exclusive inclusive rows x rows loops node
1. 318.098 4,560.641 ↑ 59,619.6 7 1

GroupAggregate (cost=175,444.64..206,744.92 rows=417,337 width=181) (actual time=4,050.479..4,560.641 rows=7 loops=1)

  • Group Key: o.id, n.uuid, (floor(((date_part('epoch'::text, age(now(), (tr."timestamp")::timestamp with time zone)) / '86400'::double precision) / '30'::double precision)))
2. 678.762 4,242.543 ↑ 1.2 357,589 1

Sort (cost=175,444.64..176,487.99 rows=417,337 width=85) (actual time=3,948.286..4,242.543 rows=357,589 loops=1)

  • Sort Key: o.id, n.uuid, (floor(((date_part('epoch'::text, age(now(), (tr."timestamp")::timestamp with time zone)) / '86400'::double precision) / '30'::double precision)))
  • Sort Method: external merge Disk: 39744kB
3. 769.141 3,563.781 ↑ 1.2 357,589 1

Hash Join (cost=28.67..116,513.45 rows=417,337 width=85) (actual time=342.628..3,563.781 rows=357,589 loops=1)

  • Hash Cond: (tr.location_id = l.id)
4. 2,794.526 2,794.526 ↓ 1.6 1,308,795 1

Seq Scan on transactions tr (cost=0.00..101,918.81 rows=820,812 width=24) (actual time=342.473..2,794.526 rows=1,308,795 loops=1)

  • Filter: (age((('now'::cstring)::date)::timestamp without time zone, "timestamp") < '180 days'::interval)
  • Rows Removed by Filter: 1153659
5. 0.009 0.114 ↑ 3.7 7 1

Hash (cost=28.35..28.35 rows=26 width=57) (actual time=0.114..0.114 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.023 0.105 ↑ 3.7 7 1

Hash Join (cost=26.37..28.35 rows=26 width=57) (actual time=0.087..0.105 rows=7 loops=1)

  • Hash Cond: (l.organization_id = o.id)
7. 0.020 0.020 ↓ 1.1 55 1

Seq Scan on locations l (cost=0.00..1.51 rows=51 width=8) (actual time=0.009..0.020 rows=55 loops=1)

8. 0.012 0.062 ↑ 5.0 1 1

Hash (cost=26.30..26.30 rows=5 width=53) (actual time=0.062..0.062 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.023 0.050 ↑ 5.0 1 1

Hash Join (cost=1.20..26.30 rows=5 width=53) (actual time=0.043..0.050 rows=1 loops=1)

  • Hash Cond: (n.id = (o.id)::text)
  • Join Filter: (((o.id)::text = 'ee5b5e4a-67a1-0b08-79fa-1715b360a9ac'::text) OR (n.uuid = 'ee5b5e4a-67a1-0b08-79fa-1715b360a9ac'::text))
  • Rows Removed by Join Filter: 9
10. 0.007 0.007 ↑ 80.0 11 1

Seq Scan on org_uuid_map n (cost=0.00..18.80 rows=880 width=64) (actual time=0.004..0.007 rows=11 loops=1)

11. 0.011 0.020 ↓ 1.2 11 1

Hash (cost=1.09..1.09 rows=9 width=21) (actual time=0.020..0.020 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 0.009 0.009 ↓ 1.2 11 1

Seq Scan on organizations o (cost=0.00..1.09 rows=9 width=21) (actual time=0.004..0.009 rows=11 loops=1)