explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IlW1

Settings
# exclusive inclusive rows x rows loops node
1. 56.864 1,729.519 ↓ 529.2 267,238 1

Nested Loop (cost=36.94..70,919.65 rows=505 width=793) (actual time=0.263..1,729.519 rows=267,238 loops=1)

  • Planning time: 3.194 ms
  • Execution time: 1740.875 ms
2. 135.052 1,405.417 ↓ 529.2 267,238 1

Nested Loop (cost=36.79..70,806.58 rows=505 width=718) (actual time=0.261..1,405.417 rows=267,238 loops=1)

  • Join Filter: ((i.id = fa.invoice_id) AND (pi.fi_id = fa.owner_id))
  • Rows Removed by Join Filter: 400287
3. 100.404 772.895 ↓ 96.9 248,735 1

Hash Join (cost=36.37..69,201.99 rows=2,567 width=626) (actual time=0.255..772.895 rows=248,735 loops=1)

  • Hash Cond: (pi.supplier_id = seller_organization.id)
4. 175.992 672.442 ↓ 15.6 248,735 1

Hash Join (cost=27.52..68,973.45 rows=15,977 width=551) (actual time=0.202..672.442 rows=248,735 loops=1)

  • Hash Cond: ((sa.owner_id = pi.supplier_id) AND (i.program_id = pi.program_id))
5. 288.400 496.274 ↑ 1.0 667,525 1

Merge Join (cost=1.29..63,781.02 rows=667,525 width=288) (actual time=0.021..496.274 rows=667,525 loops=1)

  • Merge Cond: (i.id = sa.invoice_id)
6. 60.598 60.598 ↑ 1.0 249,440 1

Index Scan using invoices_pkey on invoices i (cost=0.42..27,363.52 rows=249,447 width=196) (actual time=0.004..60.598 rows=249,440 loops=1)

7. 147.276 147.276 ↑ 1.0 667,525 1

Index Scan using index_assets_invoice on assets sa (cost=0.42..27,450.72 rows=667,525 width=92) (actual time=0.014..147.276 rows=667,525 loops=1)

8. 0.112 0.176 ↑ 1.0 409 1

Hash (cost=20.09..20.09 rows=409 width=263) (actual time=0.176..0.176 rows=409 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 133kB
9. 0.064 0.064 ↑ 1.0 409 1

Seq Scan on program_infos pi (cost=0.00..20.09 rows=409 width=263) (actual time=0.001..0.064 rows=409 loops=1)

10. 0.030 0.049 ↑ 1.0 260 1

Hash (cost=5.60..5.60 rows=260 width=75) (actual time=0.049..0.049 rows=260 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 27kB
11. 0.019 0.019 ↑ 1.0 260 1

Seq Scan on endeavour_organizations seller_organization (cost=0.00..5.60 rows=260 width=75) (actual time=0.006..0.019 rows=260 loops=1)

12. 497.470 497.470 ↑ 1.3 3 248,735

Index Scan using index_assets_owner_invoice on assets fa (cost=0.42..0.57 rows=4 width=92) (actual time=0.001..0.002 rows=3 loops=248,735)

  • Index Cond: (invoice_id = sa.invoice_id)
13. 267.238 267.238 ↑ 1.0 1 267,238

Index Scan using endeavour_organizations_pkey on endeavour_organizations obligor_organization (cost=0.15..0.21 rows=1 width=75) (actual time=0.001..0.001 rows=1 loops=267,238)

  • Index Cond: (id = pi.buyer_id)