explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zfLD : Optimization for: test; plan #v32f

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.29..17,678.20 rows=8 width=2,110) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Merge Join (cost=1.00..17,675.22 rows=8 width=1,720) (actual rows= loops=)

  • Merge Cond: (payments.invoice_id = invoices.id)
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.71..31,823.52 rows=8 width=1,505) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.29..31,819.84 rows=8 width=1,400) (actual rows= loops=)

  • Join Filter: (transactions.payment_id = payments.id)
5. 0.000 0.000 ↓ 0.0

Index Scan using payments_invoice_id_idx on payments (cost=0.29..5,397.22 rows=1 width=91) (actual rows= loops=)

  • Filter: ((COALESCE(scheduled_due_date, due_date) < '2018-11-30'::date) AND ((status)::text = 'unpaid'::text) AND (profile_id = 1110))
6. 0.000 0.000 ↓ 0.0

Seq Scan on transactions (cost=0.00..19,796.72 rows=530,072 width=1,309) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Index Scan using categories_pkey on categories (cost=0.42..0.46 rows=1 width=105) (actual rows= loops=)

  • Index Cond: (id = transactions.category_id)
8. 0.000 0.000 ↓ 0.0

Index Scan using invoices_pkey on invoices (cost=0.29..1,690.77 rows=28,913 width=215) (actual rows= loops=)

  • Filter: (is_approved AND is_receivable)
9. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients (cost=0.29..0.37 rows=1 width=390) (actual rows= loops=)

  • Index Cond: (id = invoices.client_id)