explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sbkT

Settings
# exclusive inclusive rows x rows loops node
1. 220,503.034 221,618.518 ↓ 1.1 129,249 1

Hash Left Join (cost=2,105.26..244,958.54 rows=117,039 width=2,236) (actual time=72.041..221,618.518 rows=129,249 loops=1)

  • Hash Cond: (li.adjuster_id = usr.id)
  • Planning time: 1.180 ms
  • Execution time: 221656.854 ms
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. 256.753 1,060.297 ↓ 1.1 129,249 1

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

  • Hash Cond: (li.invoice_id = inv.id)
5. 790.156 790.156 ↑ 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.024..790.156 rows=142,211 loops=1)

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

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

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

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

  • Filter: ((state)::text <> ALL ('{failed,draft,sending,submitting}'::text[]))
  • Rows Removed by Filter: 2888
8. 3.064 55.180 ↓ 12.1 13,801 1

Hash (cost=144.11..144.11 rows=1,137 width=48) (actual time=55.180..55.180 rows=13,801 loops=1)

  • Buckets: 16384 (originally 2048) Batches: 1 (originally 1) Memory Usage: 1141kB
9. 52.116 52.116 ↓ 12.1 13,801 1

Foreign Scan on users usr (cost=100.00..144.11 rows=1,137 width=48) (actual time=0.998..52.116 rows=13,801 loops=1)