explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZrKu

Settings
# exclusive inclusive rows x rows loops node
1. 0.038 5,540.697 ↑ 59,619.6 7 1

Sort (cost=319,884.11..320,927.45 rows=417,337 width=181) (actual time=5,540.694..5,540.697 rows=7 loops=1)

  • Sort Key: (date_part('epoch'::text, min(tr."timestamp")))
  • Sort Method: quicksort Memory: 26kB
2. 271.256 5,540.659 ↑ 59,619.6 7 1

GroupAggregate (cost=175,444.64..206,744.92 rows=417,337 width=181) (actual time=5,069.047..5,540.659 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)))
3. 726.243 5,269.403 ↑ 1.2 357,586 1

Sort (cost=175,444.64..176,487.99 rows=417,337 width=85) (actual time=4,972.186..5,269.403 rows=357,586 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
4. 801.981 4,543.160 ↑ 1.2 357,586 1

Hash Join (cost=28.67..116,513.45 rows=417,337 width=85) (actual time=292.929..4,543.160 rows=357,586 loops=1)

  • Hash Cond: (tr.location_id = l.id)
5. 3,739.944 3,739.944 ↓ 1.6 1,308,784 1

Seq Scan on transactions tr (cost=0.00..101,918.81 rows=820,812 width=24) (actual time=291.630..3,739.944 rows=1,308,784 loops=1)

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.036 1.229 ↑ 3.7 7 1

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

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

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

9. 0.004 1.171 ↑ 5.0 1 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.033 1.167 ↑ 5.0 1 1

Hash Join (cost=1.20..26.30 rows=5 width=53) (actual time=1.160..1.167 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
11. 1.111 1.111 ↑ 80.0 11 1

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

12. 0.013 0.023 ↓ 1.2 11 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.010 0.010 ↓ 1.2 11 1

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