explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RWC7

Settings
# exclusive inclusive rows x rows loops node
1. 0.246 632.753 ↑ 10.3 401 1

HashAggregate (cost=224,557.53..224,598.80 rows=4,127 width=4) (actual time=632.714..632.753 rows=401 loops=1)

2. 58.397 632.507 ↑ 9.5 436 1

Hash Join (cost=13,501.21..224,547.21 rows=4,127 width=4) (actual time=367.936..632.507 rows=436 loops=1)

  • Hash Cond: (rad.returnsauthorisation_id = ra.returnsauthorisation_id)
  • Join Filter: (ra.creditstatusoverride OR ((rad.received IS NULL) AND (id.invoicedetail_id IS NULL)))
  • Rows Removed by Join Filter: 87586
3. 289.360 554.404 ↓ 1.1 88,022 1

Hash Right Join (cost=10,505.10..219,537.10 rows=80,560 width=16) (actual time=84.598..554.404 rows=88,022 loops=1)

  • Hash Cond: (id.detailnumber = rad.detailnumber)
4. 203.724 244.926 ↓ 1.0 421,438 1

Bitmap Heap Scan on invoicedetail id (cost=7,888.56..186,352.85 rows=419,630 width=8) (actual time=64.430..244.926 rows=421,438 loops=1)

  • Recheck Cond: (creditreason_id IS NOT NULL)
5. 41.202 41.202 ↓ 1.0 421,438 1

Bitmap Index Scan on invoicedetail_detailnumber_creditreason_id_notnull_dix (cost=0.00..7,783.65 rows=419,630 width=0) (actual time=41.202..41.202 rows=421,438 loops=1)

  • Index Cond: (creditreason_id IS NOT NULL)
6. 10.628 20.118 ↑ 1.0 80,410 1

Hash (cost=1,609.54..1,609.54 rows=80,560 width=16) (actual time=20.118..20.118 rows=80,410 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 3767kB
7. 9.490 9.490 ↑ 1.0 80,410 1

Seq Scan on returnsauthorisationdetail rad (cost=0.00..1,609.54 rows=80,560 width=16) (actual time=0.004..9.490 rows=80,410 loops=1)

  • Filter: (cancelled IS NULL)
  • Rows Removed by Filter: 6544
8. 7.358 19.706 ↑ 1.0 79,516 1

Hash (cost=2,002.16..2,002.16 rows=79,516 width=5) (actual time=19.706..19.706 rows=79,516 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 2874kB
9. 12.348 12.348 ↑ 1.0 79,516 1

Seq Scan on returnsauthorisation ra (cost=0.00..2,002.16 rows=79,516 width=5) (actual time=0.002..12.348 rows=79,516 loops=1)

Total runtime : 632.873 ms