explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xm4Q

Settings
# exclusive inclusive rows x rows loops node
1. 182,705.933 202,448.577 ↓ 1.1 80,134 1

Hash Left Join (cost=10,000,006,013.36..10,000,154,487.36 rows=75,232 width=2,197) (actual time=19,304.271..202,448.577 rows=80,134 loops=1)

  • Hash Cond: (li.adjuster_id = usr.id)
  • Planning time: 558.107 ms
  • Execution time: 202476.622 ms
2.          

Initplan (forHash Left Join)

3. 0.065 0.065 ↑ 1.0 1 1

Seq Scan on bp_accounts (cost=10,000,000,000.00..10,000,000,001.01 rows=1 width=16) (actual time=0.065..0.065 rows=1 loops=1)

  • Filter: ((subdomain)::text = 'experian'::text)
4. 155.580 19,685.385 ↓ 1.1 80,134 1

Hash Join (cost=5,854.02..30,530.18 rows=75,232 width=1,973) (actual time=19,234.053..19,685.385 rows=80,134 loops=1)

  • Hash Cond: (li.invoice_id = inv.id)
5. 300.575 18,316.791 ↓ 1.0 81,483 1

Bitmap Heap Scan on invoice_line_items li (cost=1,831.66..25,450.00 rows=81,467 width=1,957) (actual time=18,020.975..18,316.791 rows=81,483 loops=1)

  • Recheck Cond: (deleted_at IS NULL)
  • Filter: (client_account_id = $0)
  • Heap Blocks: exact=21054
6. 18,016.216 18,016.216 ↓ 1.0 81,483 1

Bitmap Index Scan on deleted_at (cost=0.00..1,811.30 rows=81,467 width=0) (actual time=18,016.216..18,016.216 rows=81,483 loops=1)

  • Index Cond: (deleted_at IS NULL)
7. 2.905 1,213.014 ↑ 1.0 9,435 1

Hash (cost=3,904.43..3,904.43 rows=9,435 width=32) (actual time=1,213.014..1,213.014 rows=9,435 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 718kB
8. 1,210.109 1,210.109 ↑ 1.0 9,435 1

Index Scan using idx_1589024_primary on invoices inv (cost=0.29..3,904.43 rows=9,435 width=32) (actual time=0.025..1,210.109 rows=9,435 loops=1)

  • Filter: ((state)::text <> ALL ('{failed,draft,sending,submitting}'::text[]))
  • Rows Removed by Filter: 782
9. 2.939 57.194 ↓ 12.1 13,801 1

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

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

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