explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RJK6

Settings
# exclusive inclusive rows x rows loops node
1. 45.054 348.865 ↓ 1.1 129,249 1

Hash Left Join (cost=2,964.46..53,725.84 rows=117,039 width=2,039) (actual time=25.092..348.865 rows=129,249 loops=1)

  • Hash Cond: (li.adjuster_id = usr.id)
2.          

Initplan (forHash Left Join)

3. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on bp_accounts (cost=0.00..10.75 rows=1 width=16) (actual time=0.007..0.007 rows=1 loops=1)

  • Filter: ((subdomain)::text = 'mcdonalds'::text)
4. 90.560 294.043 ↓ 1.1 129,249 1

Hash Join (cost=1,936.19..52,258.32 rows=117,039 width=2,012) (actual time=15.225..294.043 rows=129,249 loops=1)

  • Hash Cond: (li.invoice_id = inv.id)
5. 188.316 188.316 ↑ 1.0 142,211 1

Seq Scan on invoice_line_items li (cost=0.00..48,618.09 rows=142,307 width=1,996) (actual time=0.022..188.316 rows=142,211 loops=1)

  • Filter: ((deleted_at IS NULL) AND (client_account_id = $0))
  • Rows Removed by Filter: 42998
6. 2.812 15.167 ↑ 1.0 13,377 1

Hash (cost=1,768.97..1,768.97 rows=13,377 width=32) (actual time=15.167..15.167 rows=13,377 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 965kB
7. 12.355 12.355 ↑ 1.0 13,377 1

Seq Scan on invoices inv (cost=0.00..1,768.97 rows=13,377 width=32) (actual time=0.012..12.355 rows=13,377 loops=1)

  • Filter: ((state)::text <> ALL ('{failed,draft,sending,submitting}'::text[]))
  • Rows Removed by Filter: 2888
8. 3.713 9.761 ↑ 1.0 13,801 1

Hash (cost=845.01..845.01 rows=13,801 width=43) (actual time=9.761..9.761 rows=13,801 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1141kB
9. 6.048 6.048 ↑ 1.0 13,801 1

Seq Scan on users usr (cost=0.00..845.01 rows=13,801 width=43) (actual time=0.013..6.048 rows=13,801 loops=1)