explain.depesz.com

PostgreSQL's explain analyze made readable

Result: J2N6

Settings
# exclusive inclusive rows x rows loops node
1. 0.392 1.213 ↑ 1.0 1 1

Aggregate (cost=3.59..3.60 rows=1 width=32) (actual time=1.213..1.213 rows=1 loops=1)

2.          

CTE grouped_accounts

3. 0.022 0.598 ↑ 1.0 4 1

Sort (cost=1.18..1.19 rows=4 width=34) (actual time=0.596..0.598 rows=4 loops=1)

  • Sort Key: a.bank_id
  • Sort Method: quicksort Memory: 19kB
4. 0.552 0.576 ↑ 1.0 4 1

HashAggregate (cost=1.09..1.14 rows=4 width=34) (actual time=0.558..0.576 rows=4 loops=1)

  • Group Key: a.bank_id
5. 0.024 0.024 ↑ 1.0 5 1

Seq Scan on accounts a (cost=0.00..1.05 rows=5 width=40) (actual time=0.018..0.024 rows=5 loops=1)

6. 0.029 0.821 ↑ 1.0 4 1

Hash Join (cost=1.25..2.38 rows=4 width=56) (actual time=0.804..0.821 rows=4 loops=1)

  • Hash Cond: (mb.master_bank_id = b.master_bank_id)
7. 0.025 0.025 ↑ 1.0 6 1

Seq Scan on master_banks mb (cost=0.00..1.06 rows=6 width=11) (actual time=0.020..0.025 rows=6 loops=1)

8. 0.068 0.767 ↑ 1.0 4 1

Hash (cost=1.20..1.20 rows=4 width=49) (actual time=0.767..0.767 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 6kB
9. 0.042 0.699 ↑ 1.0 4 1

Hash Right Join (cost=1.10..1.20 rows=4 width=49) (actual time=0.666..0.699 rows=4 loops=1)

  • Hash Cond: (grouped_accounts.bank_id = b.bank_id)
10. 0.607 0.607 ↑ 1.0 4 1

CTE Scan on grouped_accounts (cost=0.00..0.08 rows=4 width=34) (actual time=0.601..0.607 rows=4 loops=1)

11. 0.016 0.050 ↑ 1.0 4 1

Hash (cost=1.05..1.05 rows=4 width=15) (actual time=0.050..0.050 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
12. 0.034 0.034 ↑ 1.0 4 1

Seq Scan on banks b (cost=0.00..1.05 rows=4 width=15) (actual time=0.027..0.034 rows=4 loops=1)

  • Filter: (user_id = 1)
Planning time : 1.005 ms