explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RFi

Settings
# exclusive inclusive rows x rows loops node
1. 0.171 635.051 ↑ 10.3 401 1

HashAggregate (cost=224,541.62..224,582.89 rows=4,127 width=4) (actual time=635.015..635.051 rows=401 loops=1)

2. 58.700 634.880 ↑ 9.5 436 1

Hash Join (cost=13,485.21..224,531.30 rows=4,127 width=4) (actual time=373.544..634.880 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. 296.331 556.582 ↓ 1.1 88,022 1

Hash Right Join (cost=10,489.10..219,521.19 rows=80,560 width=16) (actual time=85.343..556.582 rows=88,022 loops=1)

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

Bitmap Heap Scan on invoicedetail id (cost=7,872.56..186,336.87 rows=419,631 width=8) (actual time=64.964..240.029 rows=421,438 loops=1)

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

Bitmap Index Scan on invoicedetail_invoicedetail_id_creditreason_id_notnull_idx (cost=0.00..7,767.65 rows=419,631 width=0) (actual time=42.141..42.141 rows=421,438 loops=1)

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

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

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

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

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

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

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

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

Total runtime : 635.144 ms