explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3CmG

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 5,268.965 ↓ 0.0 0 1

Unique (cost=3,320,110.19..3,320,110.23 rows=1 width=94) (actual time=5,268.965..5,268.965 rows=0 loops=1)

2. 0.015 5,268.964 ↓ 0.0 0 1

Sort (cost=3,320,110.19..3,320,110.20 rows=1 width=94) (actual time=5,268.964..5,268.964 rows=0 loops=1)

  • Sort Key: account_entry.id, account_entry.summa, account_chart.code, kbk_activity_type.code, kbk.kbk_type, kbk.full_code, account_entry.debet_kbk_id, account_entry.credit_kbk_id, t10.debet_kbk_id, t10.credit_kbk_id, account_entry.credit_account_id, (...)
  • Sort Method: quicksort Memory: 25kB
3. 0.001 5,268.949 ↓ 0.0 0 1

Nested Loop Left Join (cost=3,303,731.47..3,320,110.18 rows=1 width=94) (actual time=5,268.949..5,268.949 rows=0 loops=1)

4. 0.001 5,268.948 ↓ 0.0 0 1

Nested Loop Left Join (cost=3,303,730.90..3,320,108.07 rows=1 width=74) (actual time=5,268.948..5,268.948 rows=0 loops=1)

5. 0.000 5,268.947 ↓ 0.0 0 1

Nested Loop Left Join (cost=3,303,730.47..3,320,105.41 rows=1 width=70) (actual time=5,268.947..5,268.947 rows=0 loops=1)

  • Join Filter: (account_entry.kvd_id = kbk_activity_type.id)
6. 0.001 5,268.947 ↓ 0.0 0 1

Nested Loop Left Join (cost=3,303,730.18..3,320,102.89 rows=1 width=68) (actual time=5,268.947..5,268.947 rows=0 loops=1)

7. 0.000 5,268.946 ↓ 0.0 0 1

Nested Loop Left Join (cost=3,303,729.75..3,320,100.24 rows=1 width=43) (actual time=5,268.946..5,268.946 rows=0 loops=1)

  • Join Filter: (account_entry.debet_account_id = account_chart.id)
8. 21.618 5,268.946 ↓ 0.0 0 1

Index Scan using account_ent_debet_k_eb084e_partial on account_entry (cost=3,303,729.32..3,320,097.58 rows=1 width=38) (actual time=5,268.946..5,268.946 rows=0 loops=1)

  • Index Cond: (debet_kbk_id = ANY ('{269867,459695,448627,448628,448629,448630,448631,448632,448633,448634,448635,448636,448637,448639}'::integer[]))
  • Filter: ((operation_date >= '2019-01-01'::date) AND (operation_date <= '2019-03-31'::date) AND ((NOT (hashed SubPlan 1)) OR (NOT is_technical)) AND (debet_account_id = 1378666) AND (kvd_id = 19208) AND (state = 2 (...)
  • Rows Removed by Filter: 2849
9.          

SubPlan (forIndex Scan)

10. 0.000 5,247.328 ↓ 1.9 26,991 1

Gather (cost=1,000.00..3,303,693.24 rows=14,205 width=4) (actual time=370.642..5,247.328 rows=26,991 loops=1)

  • Workers Planned: 8
  • Workers Launched: 8
11. 5,251.875 5,251.875 ↓ 1.7 2,999 9

Parallel Seq Scan on document_acc_entry_template u2 (cost=0.00..3,301,272.74 rows=1,776 width=4) (actual time=295.146..5,251.875 rows=2,999 loops=9)

  • Filter: (yc_function = ANY ('{9,10,11}'::integer[]))
  • Rows Removed by Filter: 26319339
12. 0.000 0.000 ↓ 0.0 0

Index Scan using account_chart_pkey on account_chart (cost=0.43..2.65 rows=1 width=9) (never executed)

  • Index Cond: (id = 1378666)
13. 0.000 0.000 ↓ 0.0 0

Index Scan using kbk_pkey on kbk (cost=0.42..2.64 rows=1 width=29) (never executed)

  • Index Cond: (account_entry.debet_kbk_id = id)
14. 0.000 0.000 ↓ 0.0 0

Index Scan using kbk_activity_type_pkey on kbk_activity_type (cost=0.29..2.51 rows=1 width=6) (never executed)

  • Index Cond: (id = 19208)
15. 0.000 0.000 ↓ 0.0 0

Index Scan using operation_entry_main_entry_id on operation_entry (cost=0.43..2.65 rows=1 width=8) (never executed)

  • Index Cond: (account_entry.id = main_entry_id)
16. 0.000 0.000 ↓ 0.0 0

Index Scan using account_entry_pkey on account_entry t10 (cost=0.56..2.10 rows=1 width=12) (never executed)

  • Index Cond: (operation_entry.offbalance_entry_id = id)