explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3uXa

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

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

2. 0.067 18.343 ↓ 24.0 24 1

Sort (cost=2,076.44..2,076.44 rows=1 width=361) (actual time=18.340..18.343 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.203 18.276 ↓ 24.0 24 1

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

4. 0.046 16.393 ↓ 24.0 24 1

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

5. 0.055 16.059 ↓ 24.0 24 1

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

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

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

  • Join Filter: (pro.presentation_uom_id = xu.uom_id)
  • Rows Removed by Join Filter: 192
7. 0.022 0.022 ↑ 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.022 rows=9 loops=1)

8. 0.058 15.786 ↓ 24.0 24 9

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

9. 0.037 15.728 ↓ 24.0 24 1

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

10. 0.045 15.595 ↓ 24.0 24 1

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

11. 0.047 15.430 ↓ 24.0 24 1

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

12. 0.044 14.159 ↓ 24.0 24 1

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

13. 0.322 12.651 ↑ 3.7 24 1

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

14. 0.303 7.105 ↓ 2.7 653 1

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

15. 0.057 0.057 ↑ 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=0.056..0.057 rows=1 loops=1)

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

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

  • Recheck Cond: (warehouse_source_location_id = wl.warehouse_location_id)
  • Heap Blocks: exact=652
17. 0.161 0.161 ↓ 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=0.161..0.161 rows=653 loops=1)

  • Index Cond: (warehouse_source_location_id = wl.warehouse_location_id)
18. 5.224 5.224 ↓ 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.008..0.008 rows=0 loops=653)

  • Index Cond: (document_id = dlt.document_id)
  • Filter: ((document_id IS NULL) OR ((type)::text = 'ORDER_OF_MOVE'::text))
  • Rows Removed by Filter: 1
19. 1.464 1.464 ↑ 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=0.042..0.061 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.224 1.224 ↑ 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.032..0.051 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.004..0.004 rows=1 loops=24)

  • Index Cond: (warehouse_location_id = dlt.warehouse_source_location_id)
23. 0.096 0.096 ↑ 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.004 rows=1 loops=24)

  • Index Cond: ((product_id = dlt.product_id) AND (source_uom_id = 1))
24. 0.288 0.288 ↑ 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.012..0.012 rows=1 loops=24)

  • Index Cond: (document_id = dt.document_parent_id)
25. 1.248 1.248 ↑ 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=0.035..0.052 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.312 0.312 ↑ 1.0 1 24

Result (cost=0.00..0.26 rows=1 width=32) (actual time=0.012..0.013 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.721 ms
Execution time : 18.620 ms