explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TLVP

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop (cost=22,213.61..27,499.76 rows=1 width=125) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=22,213.33..27,499.15 rows=1 width=92) (actual rows= loops=)

  • Filter: (((coreq.order_number IS NULL) OR (cores.order_number IS NOT NULL)) AND ((cores.delivery_date = '2020-05-22'::date) OR ((cores.delivery_date IS NULL) AND (coreq.order_number IS NULL))))
3. 0.000 0.000 ↓ 0.0

Gather (cost=22,210.24..27,488.53 rows=2 width=98) (actual rows= loops=)

  • Workers Planned: 2
4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=21,210.24..26,488.33 rows=1 width=98) (actual rows= loops=)

  • Filter: ((ddt.macrozone_uuid IS NULL) OR (mz.layer_name = 'CourierDelivery'::text))
5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=21,209.95..26,487.19 rows=1 width=94) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=21,209.52..26,484.65 rows=1 width=84) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on delivery_department_task ddt (cost=21,208.96..25,065.84 rows=409 width=65) (actual rows= loops=)

  • Recheck Cond: ((state = 'WAITING'::state_delivery_department) AND (responsible_branch = '270'::text))
  • Filter: ((deleted IS FALSE) AND (NOT open_problem) AND (NOT not_coordinated_pdz) AND (partition_date >= '2020-02-22'::date) AND (delivery_true_mode_code = ANY ('{1,3}'::text[])) AND (type_basis = 'ORDER'::type_basis) AND (((layout_date)::date <> '2020-05-22'::date) OR (layout_date IS NULL)))
8. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=21,208.96..21,208.96 rows=3,488 width=0) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on delivery_department_task_state_idx (cost=0.00..5,882.97 rows=194,868 width=0) (actual rows= loops=)

  • Index Cond: (state = 'WAITING'::state_delivery_department)
10. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on delivery_department_task_responsible_branch_idx (cost=0.00..15,325.25 rows=316,145 width=0) (actual rows= loops=)

  • Index Cond: (responsible_branch = '270'::text)
11. 0.000 0.000 ↓ 0.0

Index Scan using cargo_place_warehouse_order_number_index on cargo_place_warehouse cpw (cost=0.56..3.46 rows=1 width=37) (actual rows= loops=)

  • Index Cond: (order_number = ddt.number_basis)
  • Filter: (ddt.partition_date = partition_date)
12. 0.000 0.000 ↓ 0.0

Index Scan using call_order_requirement_order_number_index on call_order_requirement coreq (cost=0.43..2.54 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (order_number = ddt.number_basis)
  • Filter: (NOT deleted)
13. 0.000 0.000 ↓ 0.0

Index Scan using macro_zone_pkey on macro_zone mz (cost=0.29..1.13 rows=1 width=51) (actual rows= loops=)

  • Index Cond: (uuid = ddt.macrozone_uuid)
14. 0.000 0.000 ↓ 0.0

Index Scan using pk_order_call_result_uuid on call_order_result cores (cost=3.10..5.30 rows=1 width=30) (actual rows= loops=)

  • Index Cond: (uuid = (SubPlan 1))
15.          

SubPlan (for Index Scan)

16. 0.000 0.000 ↓ 0.0

Limit (cost=2.66..2.67 rows=1 width=24) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Sort (cost=2.66..2.67 rows=1 width=24) (actual rows= loops=)

  • Sort Key: call_order_result.date_call DESC
18. 0.000 0.000 ↓ 0.0

Index Scan using call_order_result_order_number_unique on call_order_result (cost=0.43..2.65 rows=1 width=24) (actual rows= loops=)

  • Index Cond: (order_number = ddt.number_basis)
19. 0.000 0.000 ↓ 0.0

Index Scan using tariff_type_code_lang_key on tariff_type tt (cost=0.28..0.61 rows=1 width=39) (actual rows= loops=)

  • Index Cond: ((code = ddt.tariff_code) AND (lang = 'rus'::text))