explain.depesz.com

PostgreSQL's explain analyze made readable

Result: j0qD : Optimization for: plan #7CQK

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 2.262 37,767.512 ↓ 4,725.0 4,725 1

Unique (cost=447.50..447.53 rows=1 width=87) (actual time=37,764.631..37,767.512 rows=4,725 loops=1)

2. 8.488 37,765.250 ↓ 4,725.0 4,725 1

Sort (cost=447.50..447.50 rows=1 width=87) (actual time=37,764.629..37,765.250 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. 6.080 37,756.762 ↓ 4,725.0 4,725 1

Nested Loop Left Join (cost=1.85..447.49 rows=1 width=87) (actual time=19.563..37,756.762 rows=4,725 loops=1)

4. 5.748 37,750.682 ↓ 4,725.0 4,725 1

Nested Loop Left Join (cost=1.29..439.65 rows=1 width=67) (actual time=19.559..37,750.682 rows=4,725 loops=1)

5. 10.940 37,329.134 ↓ 4,725.0 4,725 1

Nested Loop Left Join (cost=0.85..431.19 rows=1 width=63) (actual time=19.540..37,329.134 rows=4,725 loops=1)

6. 37,275.669 37,275.669 ↓ 4,725.0 4,725 1

Index Scan using account_entry_debet_account_kvd on account_entry (cost=0.57..422.88 rows=1 width=38) (actual time=19.498..37,275.669 rows=4,725 loops=1)

  • Index 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
7. 42.525 42.525 ↑ 1.0 1 4,725

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

  • Index Cond: (account_entry.debet_kbk_id = id)
8. 415.800 415.800 ↓ 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.088..0.088 rows=0 loops=4,725)

  • Index Cond: (account_entry.id = main_entry_id)
9. 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 : 63.669 ms
Execution time : 37,767.874 ms