explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lNce

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

Sort (cost=11,104.60..11,105.18 rows=234 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=11,012.64..11,095.39 rows=234 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=11,011.00..11,011.00 rows=131 width=2,613) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Unique (cost=11,007.40..11,009.69 rows=131 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=4,343.08..4,343.41 rows=131 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

Hash Left Join (cost=3,368.39..4,338.47 rows=131 width=2,613) (actual rows= loops=)

  • Hash Cond: (doc.id = feature_login.entity_id)
20. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=3,128.51..4,096.78 rows=131 width=2,519) (actual rows= loops=)

  • Hash Cond: (doc.id = feature_uid.entity_id)
21. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2,888.62..3,855.74 rows=131 width=2,487) (actual rows= loops=)

  • Hash Cond: (doc.id = feature_number_range.entity_id)
22. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2,648.74..3,614.70 rows=131 width=2,455) (actual rows= loops=)

  • Hash Cond: (assortment.id = feature_description_3.entity_id)
23. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2,213.03..3,177.00 rows=131 width=2,427) (actual rows= loops=)

  • Hash Cond: (assortment.id = feature_description_2.entity_id)
24. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,777.32..2,739.31 rows=131 width=2,395) (actual rows= loops=)

  • Hash Cond: (assortment.id = feature_description_1.entity_id)
25. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,341.61..2,301.61 rows=131 width=2,363) (actual rows= loops=)

  • Hash Cond: (assortment.assortment_group_id = a_group.id)
26. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,334.90..2,293.26 rows=131 width=2,358) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,334.61..2,248.90 rows=131 width=2,351) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,334.32..2,222.49 rows=73 width=2,351) (actual rows= loops=)

  • Hash Cond: (address.country_id = country.id)
29. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,322.72..2,209.96 rows=73 width=2,344) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,322.43..2,173.81 rows=73 width=2,284) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,322.01..2,124.52 rows=73 width=2,282) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,321.74..2,103.03 rows=73 width=2,279) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,321.46..2,080.03 rows=73 width=2,267) (actual rows= loops=)

  • Hash Cond: (shipping_parameters.shipping_definition_id = shipping_definition.id)
34. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,317.70..2,075.36 rows=73 width=1,755) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,317.41..2,049.95 rows=73 width=1,755) (actual rows= loops=)

  • Hash Cond: (doc.type_definition_id = doc_type_definition.id)
36. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,315.69..2,047.32 rows=73 width=1,243) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,315.41..1,990.91 rows=155 width=1,222) (actual rows= loops=)

  • Hash Cond: (despatch_history.despatch_document_id = doc.id)
38. 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=)

39. 0.000 0.000 ↓ 0.0

Hash (cost=1,313.83..1,313.83 rows=126 width=1,150) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Merge Join (cost=0.99..1,313.83 rows=126 width=1,150) (actual rows= loops=)

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

Nested Loop (cost=0.71..2,039.51 rows=126 width=1,122) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..1,685.86 rows=780 width=1,102) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Index Scan using fki_collective_documents_shipping_order_id_fkey on warehouse_document doc (cost=0.29..1,436.25 rows=1,560 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))
44. 0.000 0.000 ↓ 0.0

Index Scan using logical_warehouse_pkey on logical_warehouse warehouse (cost=0.14..0.16 rows=1 width=1,036) (actual rows= loops=)

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

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

  • Index Cond: (id = doc.contractor_id)
  • Filter: (NOT is_deleted)
46. 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)
47. 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))
48. 0.000 0.000 ↓ 0.0

Hash (cost=1.32..1.32 rows=32 width=520) (actual rows= loops=)

49. 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=)

50. 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)
51. 0.000 0.000 ↓ 0.0

Hash (cost=2.78..2.78 rows=78 width=520) (actual rows= loops=)

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

Hash (cost=8.49..8.49 rows=249 width=15) (actual rows= loops=)

58. 0.000 0.000 ↓ 0.0

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

59. 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)
60. 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)
61. 0.000 0.000 ↓ 0.0

Hash (cost=4.65..4.65 rows=165 width=13) (actual rows= loops=)

62. 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=)

63. 0.000 0.000 ↓ 0.0

Hash (cost=434.50..434.50 rows=97 width=36) (actual rows= loops=)

64. 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)
65. 0.000 0.000 ↓ 0.0

Hash (cost=434.50..434.50 rows=97 width=36) (actual rows= loops=)

66. 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)
67. 0.000 0.000 ↓ 0.0

Hash (cost=434.50..434.50 rows=97 width=36) (actual rows= loops=)

68. 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)
69. 0.000 0.000 ↓ 0.0

Hash (cost=239.22..239.22 rows=53 width=36) (actual rows= loops=)

70. 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)
71. 0.000 0.000 ↓ 0.0

Hash (cost=239.22..239.22 rows=53 width=36) (actual rows= loops=)

72. 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)
73. 0.000 0.000 ↓ 0.0

Hash (cost=239.22..239.22 rows=53 width=36) (actual rows= loops=)

74. 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)