explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8jCG

Settings
# exclusive inclusive rows x rows loops node
1. 0.016 145.431 ↓ 24.0 24 1

Unique (cost=2,076.44..2,076.48 rows=1 width=361) (actual time=145.412..145.431 rows=24 loops=1)

2. 0.077 145.415 ↓ 24.0 24 1

Sort (cost=2,076.44..2,076.44 rows=1 width=361) (actual time=145.412..145.415 rows=24 loops=1)

  • Sort Key: dt.observations, im.movement_date, dt.pos, dt.doc_number, dlt.cant, wl._type, av.value_string, ((SubPlan 1)), ((SubPlan 2)), pro.product_client_id, pro.name, wl_source.name, ((((xue.rate * (dlt.cant)::double precision))::text || (xu.uomsymbol)::text)), wl_source._type, d_parent.doc_number, av_sap.value_integer
  • Sort Method: quicksort Memory: 31kB
3. 0.242 145.338 ↓ 24.0 24 1

Nested Loop Left Join (cost=15.62..2,076.43 rows=1 width=361) (actual time=130.655..145.338 rows=24 loops=1)

4. 0.027 113.920 ↓ 24.0 24 1

Nested Loop Left Join (cost=15.06..2,070.06 rows=1 width=187) (actual time=113.361..113.920 rows=24 loops=1)

5. 0.054 113.557 ↓ 24.0 24 1

Nested Loop (cost=14.77..2,069.49 rows=1 width=178) (actual time=113.341..113.557 rows=24 loops=1)

  • Join Filter: ((pro.product_id = xue.product_id) AND (xu.uom_id = xue.target_uom_id))
6. 0.084 113.383 ↓ 24.0 24 1

Nested Loop (cost=14.62..2,069.31 rows=1 width=186) (actual time=113.307..113.383 rows=24 loops=1)

  • Join Filter: (pro.presentation_uom_id = xu.uom_id)
  • Rows Removed by Join Filter: 192
7. 0.025 0.025 ↑ 1.0 9 1

Index Scan using uom_uom_id_idx on uom xu (cost=0.14..12.27 rows=9 width=42) (actual time=0.020..0.025 rows=9 loops=1)

8. 0.081 113.274 ↓ 24.0 24 9

Materialize (cost=14.49..2,056.90 rows=1 width=144) (actual time=7.258..12.586 rows=24 loops=9)

9. 0.025 113.193 ↓ 24.0 24 1

Nested Loop Left Join (cost=14.49..2,056.90 rows=1 width=144) (actual time=65.319..113.193 rows=24 loops=1)

10. 0.036 113.072 ↓ 24.0 24 1

Nested Loop (cost=14.20..2,056.58 rows=1 width=131) (actual time=65.309..113.072 rows=24 loops=1)

11. 0.045 112.916 ↓ 24.0 24 1

Nested Loop Left Join (cost=13.93..2,056.28 rows=1 width=88) (actual time=65.281..112.916 rows=24 loops=1)

12. 0.056 111.815 ↓ 24.0 24 1

Nested Loop (cost=13.49..2,055.67 rows=1 width=77) (actual time=65.235..111.815 rows=24 loops=1)

13. 1.083 81.423 ↑ 3.7 24 1

Nested Loop (cost=13.07..2,008.25 rows=88 width=73) (actual time=65.176..81.423 rows=24 loops=1)

14. 0.368 73.810 ↓ 2.7 653 1

Nested Loop (cost=12.77..1,928.70 rows=246 width=41) (actual time=65.128..73.810 rows=653 loops=1)

15. 31.028 31.028 ↑ 1.0 1 1

Index Scan using warehouse_locations_name_idx on warehouse_locations wl (cost=0.41..8.43 rows=1 width=21) (actual time=31.027..31.028 rows=1 loops=1)

  • Index Cond: ((name)::text = 'C.66.1.0'::text)
16. 8.444 42.414 ↓ 1.3 653 1

Bitmap Heap Scan on document_line dlt (cost=12.36..1,915.20 rows=507 width=24) (actual time=34.088..42.414 rows=653 loops=1)

  • Recheck Cond: (warehouse_source_location_id = wl.warehouse_location_id)
  • Heap Blocks: exact=652
17. 33.970 33.970 ↓ 1.3 653 1

Bitmap Index Scan on document_line_warehouse_source_location_id_idx (cost=0.00..12.23 rows=507 width=0) (actual time=33.970..33.970 rows=653 loops=1)

  • Index Cond: (warehouse_source_location_id = wl.warehouse_location_id)
18. 6.530 6.530 ↓ 0.0 0 653

Index Scan using document_id_idx on document dt (cost=0.29..0.31 rows=1 width=40) (actual time=0.010..0.010 rows=0 loops=653)

  • Index Cond: (document_id = dlt.document_id)
  • Filter: ((type)::text = 'ORDER_OF_MOVE'::text)
  • Rows Removed by Filter: 1
19. 30.336 30.336 ↑ 1.0 1 24

Index Scan using instances_movements_product_instance_id_idx_1 on instances_movements im (cost=0.42..0.53 rows=1 width=16) (actual time=1.250..1.264 rows=1 loops=24)

  • Index Cond: (product_instance_id = dlt.product_instance_id)
  • Filter: (dlt.warehouse_location_id = warehouse_location_id)
  • Rows Removed by Filter: 4
20. 1.056 1.056 ↑ 1.0 1 24

Index Scan using attributes_values_only_entity_id_idx on attributes_values av (cost=0.43..0.61 rows=1 width=15) (actual time=0.026..0.044 rows=1 loops=24)

  • Index Cond: (entity_id = dlt.product_instance_id)
  • Filter: (((entity_class)::text = 'ProductInstance'::text) AND (attributes_type_param_id = 3))
  • Rows Removed by Filter: 4
21. 0.120 0.120 ↑ 1.0 1 24

Index Scan using products_pkey on products pro (cost=0.28..0.29 rows=1 width=43) (actual time=0.005..0.005 rows=1 loops=24)

  • Index Cond: (product_id = dlt.product_id)
22. 0.096 0.096 ↑ 1.0 1 24

Index Scan using warehouse_locations_warehouse_location_id_idx on warehouse_locations wl_source (cost=0.29..0.31 rows=1 width=21) (actual time=0.003..0.004 rows=1 loops=24)

  • Index Cond: (warehouse_location_id = dlt.warehouse_source_location_id)
23. 0.120 0.120 ↑ 1.0 1 24

Index Scan using uom_equivalence_product_id_idx on uom_equivalence xue (cost=0.14..0.17 rows=1 width=16) (actual time=0.004..0.005 rows=1 loops=24)

  • Index Cond: ((product_id = dlt.product_id) AND (source_uom_id = 1))
24. 0.336 0.336 ↑ 1.0 1 24

Index Scan using document_id_idx on document d_parent (cost=0.29..0.56 rows=1 width=13) (actual time=0.013..0.014 rows=1 loops=24)

  • Index Cond: (document_id = dt.document_parent_id)
25. 30.720 30.720 ↑ 1.0 1 24

Index Scan using attributes_values_entity_id_idx on attributes_values av_sap (cost=0.56..5.83 rows=1 width=8) (actual time=1.263..1.280 rows=1 loops=24)

  • Index Cond: ((entity_id = d_parent.document_id) AND ((entity_class)::text = 'OutputOrder'::text))
  • Filter: (attributes_type_param_id = 20)
  • Rows Removed by Filter: 6
26.          

SubPlan (for Nested Loop Left Join)

27. 0.336 0.336 ↑ 1.0 1 24

Result (cost=0.00..0.26 rows=1 width=32) (actual time=0.014..0.014 rows=1 loops=24)

28. 0.120 0.120 ↑ 1.0 1 24

Result (cost=0.00..0.26 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=24)

Planning time : 8.560 ms
Execution time : 145.691 ms