explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7CQK

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 2.487 85,224.893 ↓ 4,725.0 4,725 1

Unique (cost=13,015.06..13,015.09 rows=1 width=87) (actual time=85,221.711..85,224.893 rows=4,725 loops=1)

2. 10.322 85,222.406 ↓ 4,725.0 4,725 1

Sort (cost=13,015.06..13,015.06 rows=1 width=87) (actual time=85,221.700..85,222.406 rows=4,725 loops=1)

  • Sort Key: account_entry.id, account_entry.summa, kbk.full_code, kbk.kbk_type, account_entry.debet_kbk_id, account_entry.credit_kbk_id, t9.debet_kbk_id, t9.credit_kbk_id, account_entry.credit_account_id, account_entry.debet_kvd_analytic_id, account_ (...)
  • Sort Method: quicksort Memory: 857kB
3. 5.813 85,212.084 ↓ 4,725.0 4,725 1

Nested Loop Left Join (cost=12,620.36..13,015.05 rows=1 width=87) (actual time=304.821..85,212.084 rows=4,725 loops=1)

4. 2.802 85,206.271 ↓ 4,725.0 4,725 1

Nested Loop Left Join (cost=12,619.79..13,007.21 rows=1 width=67) (actual time=304.812..85,206.271 rows=4,725 loops=1)

5. 13.788 84,688.444 ↓ 4,725.0 4,725 1

Nested Loop Left Join (cost=12,619.36..12,998.75 rows=1 width=63) (actual time=292.492..84,688.444 rows=4,725 loops=1)

6. 84,314.903 84,589.606 ↓ 4,725.0 4,725 1

Bitmap Heap Scan on account_entry (cost=12,619.07..12,990.44 rows=1 width=38) (actual time=292.434..84,589.606 rows=4,725 loops=1)

  • Recheck Cond: ((debet_account_id = 186837) AND (kvd_id = 2651))
  • Filter: ((NOT transition) AND (operation_date >= '2019-01-01'::date) AND (operation_date <= '2019-06-30'::date) AND (state = 2) AND (ent_id = 1484) AND (debet_kbk_id = ANY ('{35843,43651,46215,46216,5897,42761,44939,46217,43 (...)
  • Rows Removed by Filter: 36501
  • Heap Blocks: exact=24446
7. 7.276 274.703 ↓ 0.0 0 1

BitmapAnd (cost=12,619.07..12,619.07 rows=91 width=0) (actual time=274.703..274.703 rows=0 loops=1)

8. 57.641 57.641 ↓ 4.9 50,542 1

Bitmap Index Scan on account_entry_debet_account_id (cost=0.00..193.75 rows=10,291 width=0) (actual time=57.641..57.641 rows=50,542 loops=1)

  • Index Cond: (debet_account_id = 186837)
9. 209.786 209.786 ↓ 1.0 691,397 1

Bitmap Index Scan on account_ent_kvd_id_84943d_partial (cost=0.00..12,425.07 rows=672,600 width=0) (actual time=209.786..209.786 rows=691,397 loops=1)

  • Index Cond: (kvd_id = 2651)
10. 85.050 85.050 ↑ 1.0 1 4,725

Index Scan using kbk_pkey on kbk (cost=0.29..8.30 rows=1 width=29) (actual time=0.018..0.018 rows=1 loops=4,725)

  • Index Cond: (account_entry.debet_kbk_id = id)
11. 515.025 515.025 ↓ 0.0 0 4,725

Index Scan using operation_entry_main_entry_id on operation_entry (cost=0.43..8.45 rows=1 width=8) (actual time=0.109..0.109 rows=0 loops=4,725)

  • Index Cond: (account_entry.id = main_entry_id)
12. 0.000 0.000 ↓ 0.0 0 4,725

Index Scan using account_entry_pkey on account_entry t9 (cost=0.57..7.82 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=4,725)

  • Index Cond: (operation_entry.offbalance_entry_id = id)
Planning time : 84.442 ms
Execution time : 85,225.504 ms