explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GV7u

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

Sort (cost=10,347.09..10,347.10 rows=4 width=3,001) (actual rows= loops=)

  • Sort Key: pos.real_create_date DESC, (naturalsort((despatch_history.despatch_document_number)::text))
2. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=10,324.10..10,347.05 rows=4 width=3,001) (actual rows= loops=)

  • Hash Cond: (_pivot_output.position_id = despatch_history.despatch_document_position_id)
3. 0.000 0.000 ↓ 0.0

Seq Scan on _pivot_output (cost=0.00..20.57 rows=357 width=356) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Hash (cost=10,324.07..10,324.07 rows=2 width=2,613) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Unique (cost=10,324.02..10,324.05 rows=2 width=2,613) (actual rows= loops=)

6.          

CTE description_features

7. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,261.02..2,411.69 rows=19,311 width=16) (actual rows= loops=)

  • Hash Cond: (feature.value_id = feature_value.id)
8. 0.000 0.000 ↓ 0.0

Index Scan using dynamic_valuable_feature_definition_id on dynamic_valuable_feature feature (cost=0.29..907.15 rows=19,311 width=12) (actual rows= loops=)

  • Index Cond: (definition_id = ANY ('{1,2,3}'::integer[]))
  • Filter: (NOT is_deleted)
9. 0.000 0.000 ↓ 0.0

Hash (cost=769.77..769.77 rows=39,277 width=12) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on dynamic_valuable_feature_value feature_value (cost=0.00..769.77 rows=39,277 width=12) (actual rows= loops=)

11.          

CTE document_features

12. 0.000 0.000 ↓ 0.0

Unique (cost=4,109.97..4,252.64 rows=10,632 width=40) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Sort (cost=4,109.97..4,157.53 rows=19,022 width=40) (actual rows= loops=)

  • Sort Key: feature_1.entity_id, feature_1.definition_id
14. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,260.73..2,757.95 rows=19,022 width=40) (actual rows= loops=)

  • Hash Cond: (feature_1.value_id = feature_value_1.id)
15. 0.000 0.000 ↓ 0.0

Seq Scan on dynamic_valuable_feature feature_1 (cost=0.00..1,019.29 rows=19,022 width=12) (actual rows= loops=)

  • Filter: ((NOT is_deleted) AND (NOT is_deleted) AND (entity_name = 'Feniks.Domain.WarehouseDocument'::text))
16. 0.000 0.000 ↓ 0.0

Hash (cost=769.77..769.77 rows=39,277 width=37) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Seq Scan on dynamic_valuable_feature_value feature_value_1 (cost=0.00..769.77 rows=39,277 width=37) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Sort (cost=3,659.69..3,659.70 rows=2 width=2,613) (actual rows= loops=)

  • Sort Key: despatch_history.despatch_document_position_id, despatch_history.serial_number, despatch_history.lot_number, despatch_history.expiration_date, despatch_history.imei1_number, despatch_history.imei2_number
19. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3.27..3,659.68 rows=2 width=2,613) (actual rows= loops=)

  • Join Filter: (feature_login.entity_id = doc.id)
20. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3.27..3,418.60 rows=2 width=2,519) (actual rows= loops=)

  • Join Filter: (feature_uid.entity_id = doc.id)
21. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3.27..3,177.52 rows=2 width=2,487) (actual rows= loops=)

  • Join Filter: (feature_number_range.entity_id = doc.id)
22. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3.27..2,936.45 rows=2 width=2,455) (actual rows= loops=)

  • Join Filter: (feature_description_3.entity_id = assortment.id)
23. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3.27..2,498.56 rows=2 width=2,427) (actual rows= loops=)

  • Join Filter: (feature_description_2.entity_id = assortment.id)
24. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3.27..2,060.66 rows=2 width=2,395) (actual rows= loops=)

  • Join Filter: (feature_description_1.entity_id = assortment.id)
25. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3.27..1,622.77 rows=2 width=2,363) (actual rows= loops=)

  • Join Filter: (assortment.assortment_group_id = a_group.id)
26. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3.27..1,612.76 rows=2 width=2,358) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2.98..1,612.08 rows=2 width=2,351) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2.69..1,611.72 rows=1 width=2,351) (actual rows= loops=)

  • Join Filter: (address.country_id = country.id)
29. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2.69..1,600.12 rows=1 width=2,344) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2.40..1,599.62 rows=1 width=2,284) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.99..1,598.95 rows=1 width=2,282) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.71..1,598.65 rows=1 width=2,279) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.43..1,598.34 rows=1 width=2,267) (actual rows= loops=)

  • Join Filter: (shipping_parameters.shipping_definition_id = shipping_definition.id)
34. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.43..1,594.58 rows=1 width=1,755) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.14..1,594.23 rows=1 width=1,755) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Merge Join (cost=0.85..1,593.51 rows=2 width=1,734) (actual rows= loops=)

  • Merge Cond: (doc.shipping_order_id = shipping_order.id)
37. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..2,697.71 rows=2 width=1,706) (actual rows= loops=)

  • Join Filter: (doc.type_definition_id = doc_type_definition.id)
38. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..2,695.35 rows=2 width=1,194) (actual rows= loops=)

  • Join Filter: (doc.id = despatch_history.despatch_document_id)
39. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..1,617.91 rows=2 width=1,122) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..1,591.89 rows=12 width=1,102) (actual rows= loops=)

  • Join Filter: (doc.target_warehouse_id = warehouse.id)
41. 0.000 0.000 ↓ 0.0

Index Scan using fki_collective_documents_shipping_order_id_fkey on warehouse_document doc (cost=0.29..1,579.60 rows=23 width=74) (actual rows= loops=)

  • Filter: ((NOT is_deleted) AND (warehouse_document_type_id = 3) AND (CASE WHEN (COALESCE(('{1}'::integer[])[1], 1) = 1) THEN create_date ELSE commit_date END >= '1001-01-01'::date) AND (CASE WHEN (COALESCE(('{1}'::integer[])[1], 1) = 1) THEN create_date ELSE commit_date END < (COALESCE((now())::date) + '1 day'::interval)))
42. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..2.70 rows=28 width=1,036) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Seq Scan on logical_warehouse warehouse (cost=0.00..2.56 rows=28 width=1,036) (actual rows= loops=)

  • Filter: (NOT is_deleted)
44. 0.000 0.000 ↓ 0.0

Index Scan using contractor_pkey on contractor (cost=0.29..2.17 rows=1 width=28) (actual rows= loops=)

  • Index Cond: (id = doc.contractor_id)
  • Filter: (NOT is_deleted)
45. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..691.51 rows=14,034 width=76) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Seq Scan on allocation_despatch_history despatch_history (cost=0.00..621.34 rows=14,034 width=76) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1.48 rows=32 width=520) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Seq Scan on warehouse_document_type_definition doc_type_definition (cost=0.00..1.32 rows=32 width=520) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Index Scan using shipping_order_pkey on shipping_order (cost=0.28..227.96 rows=6,556 width=36) (actual rows= loops=)

  • Filter: (NOT is_deleted)
50. 0.000 0.000 ↓ 0.0

Index Scan using warehouse_document_position_pkey on warehouse_document_position pos (cost=0.29..0.36 rows=1 width=25) (actual rows= loops=)

  • Index Cond: (id = despatch_history.despatch_document_position_id)
  • Filter: ((NOT is_deleted) AND (type_id = 2))
51. 0.000 0.000 ↓ 0.0

Index Scan using shipping_parameters_pkey on shipping_parameters (cost=0.29..0.35 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = shipping_order.shipping_parameters_id)
52. 0.000 0.000 ↓ 0.0

Seq Scan on shipping_definition (cost=0.00..2.78 rows=78 width=520) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Index Scan using assortment_pkey on assortment (cost=0.28..0.32 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = despatch_history.assortment_id)
54. 0.000 0.000 ↓ 0.0

Index Scan using unit_pkey on unit (cost=0.28..0.29 rows=1 width=11) (actual rows= loops=)

  • Index Cond: (id = assortment.unit_id)
55. 0.000 0.000 ↓ 0.0

Index Scan using dimension_pkey on dimension (cost=0.42..0.68 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (assortment.dimension_id = id)
56. 0.000 0.000 ↓ 0.0

Index Scan using address_pkey on address (cost=0.29..0.50 rows=1 width=64) (actual rows= loops=)

  • Index Cond: (shipping_order.shipping_address_id = id)
57. 0.000 0.000 ↓ 0.0

Seq Scan on country (cost=0.00..8.49 rows=249 width=15) (actual rows= loops=)

58. 0.000 0.000 ↓ 0.0

Index Only Scan using address_contact_address_id_contact_id on address_contact (cost=0.29..0.34 rows=2 width=8) (actual rows= loops=)

  • Index Cond: (address_id = address.id)
59. 0.000 0.000 ↓ 0.0

Index Scan using contact_pkey on contact (cost=0.29..0.34 rows=1 width=15) (actual rows= loops=)

  • Index Cond: (address_contact.contact_id = id)
60. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..5.48 rows=165 width=13) (actual rows= loops=)

61. 0.000 0.000 ↓ 0.0

Seq Scan on assortment_group a_group (cost=0.00..4.65 rows=165 width=13) (actual rows= loops=)

62. 0.000 0.000 ↓ 0.0

CTE Scan on description_features feature_description_1 (cost=0.00..434.50 rows=97 width=36) (actual rows= loops=)

  • Filter: (description_nb = 1)
63. 0.000 0.000 ↓ 0.0

CTE Scan on description_features feature_description_2 (cost=0.00..434.50 rows=97 width=36) (actual rows= loops=)

  • Filter: (description_nb = 2)
64. 0.000 0.000 ↓ 0.0

CTE Scan on description_features feature_description_3 (cost=0.00..434.50 rows=97 width=36) (actual rows= loops=)

  • Filter: (description_nb = 3)
65. 0.000 0.000 ↓ 0.0

CTE Scan on document_features feature_number_range (cost=0.00..239.22 rows=53 width=36) (actual rows= loops=)

  • Filter: (description_nb = 4)
66. 0.000 0.000 ↓ 0.0

CTE Scan on document_features feature_uid (cost=0.00..239.22 rows=53 width=36) (actual rows= loops=)

  • Filter: (description_nb = 5)
67. 0.000 0.000 ↓ 0.0

CTE Scan on document_features feature_login (cost=0.00..239.22 rows=53 width=36) (actual rows= loops=)

  • Filter: (description_nb = 6)