axiom-optimizer 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +2 -1
  3. data/.rubocop.yml +6 -0
  4. data/.travis.yml +16 -20
  5. data/CONTRIBUTING.md +1 -2
  6. data/Gemfile +3 -1
  7. data/Gemfile.devtools +28 -18
  8. data/README.md +7 -13
  9. data/TODO +6 -5
  10. data/axiom-optimizer.gemspec +3 -3
  11. data/config/flay.yml +1 -1
  12. data/config/reek.yml +5 -29
  13. data/config/rubocop.yml +16 -10
  14. data/lib/axiom/optimizer.rb +3 -7
  15. data/lib/axiom/optimizer/algebra/difference.rb +2 -2
  16. data/lib/axiom/optimizer/algebra/extension.rb +6 -6
  17. data/lib/axiom/optimizer/algebra/intersection.rb +2 -2
  18. data/lib/axiom/optimizer/algebra/join.rb +4 -4
  19. data/lib/axiom/optimizer/algebra/product.rb +4 -4
  20. data/lib/axiom/optimizer/algebra/projection.rb +5 -5
  21. data/lib/axiom/optimizer/algebra/rename.rb +10 -10
  22. data/lib/axiom/optimizer/algebra/restriction.rb +8 -9
  23. data/lib/axiom/optimizer/algebra/summarization.rb +7 -7
  24. data/lib/axiom/optimizer/algebra/union.rb +2 -2
  25. data/lib/axiom/optimizer/function.rb +4 -6
  26. data/lib/axiom/optimizer/function/binary.rb +2 -2
  27. data/lib/axiom/optimizer/function/connective/binary.rb +1 -1
  28. data/lib/axiom/optimizer/function/connective/negation.rb +1 -1
  29. data/lib/axiom/optimizer/function/predicate.rb +1 -1
  30. data/lib/axiom/optimizer/function/predicate/comparable.rb +8 -6
  31. data/lib/axiom/optimizer/function/predicate/enumerable.rb +2 -2
  32. data/lib/axiom/optimizer/function/unary.rb +1 -1
  33. data/lib/axiom/optimizer/relation/operation/binary.rb +12 -12
  34. data/lib/axiom/optimizer/relation/operation/reverse.rb +9 -9
  35. data/lib/axiom/optimizer/relation/operation/{order.rb → sorted.rb} +15 -15
  36. data/lib/axiom/optimizer/relation/operation/unary.rb +7 -7
  37. data/lib/axiom/optimizer/support/predicate_partition.rb +11 -13
  38. data/lib/axiom/optimizer/version.rb +1 -1
  39. data/spec/integration/axiom/algebra/difference/optimize_spec.rb +12 -12
  40. data/spec/integration/axiom/algebra/intersection/optimize_spec.rb +12 -12
  41. data/spec/integration/axiom/algebra/join/optimize_spec.rb +6 -6
  42. data/spec/integration/axiom/algebra/product/optimize_spec.rb +10 -10
  43. data/spec/integration/axiom/algebra/projection/optimize_spec.rb +14 -14
  44. data/spec/integration/axiom/algebra/rename/optimize_spec.rb +38 -38
  45. data/spec/integration/axiom/algebra/restriction/optimize_spec.rb +12 -12
  46. data/spec/integration/axiom/algebra/summarization/optimize_spec.rb +2 -2
  47. data/spec/integration/axiom/algebra/union/optimize_spec.rb +16 -16
  48. data/spec/integration/axiom/function/optimize_spec.rb +1 -1
  49. data/spec/integration/axiom/relation/operation/limit/optimize_spec.rb +20 -20
  50. data/spec/integration/axiom/relation/operation/offset/optimize_spec.rb +14 -14
  51. data/spec/integration/axiom/relation/operation/reverse/optimize_spec.rb +15 -15
  52. data/spec/integration/axiom/relation/operation/{order → sorted}/optimize_spec.rb +6 -6
  53. data/spec/integration/axiom/relation/optimize_spec.rb +1 -1
  54. data/spec/shared/function_connective_binary_optimize_behavior.rb +8 -2
  55. data/spec/shared/optimize_method_behavior.rb +0 -11
  56. data/spec/spec_helper.rb +9 -9
  57. data/spec/support/config_alias.rb +2 -0
  58. data/spec/unit/axiom/optimizer/algebra/extension/{order_operand → sorted_operand}/optimizable_predicate_spec.rb +3 -3
  59. data/spec/unit/axiom/optimizer/algebra/extension/{order_operand → sorted_operand}/optimize_spec.rb +1 -1
  60. data/spec/unit/axiom/optimizer/algebra/rename/limit_operand/optimize_spec.rb +3 -3
  61. data/spec/unit/axiom/optimizer/algebra/rename/offset_operand/optimize_spec.rb +3 -3
  62. data/spec/unit/axiom/optimizer/algebra/rename/{order_operand → sorted_operand}/optimizable_predicate_spec.rb +3 -3
  63. data/spec/unit/axiom/optimizer/algebra/rename/{order_operand → sorted_operand}/optimize_spec.rb +2 -2
  64. data/spec/unit/axiom/optimizer/algebra/restriction/combination_operand/optimize_spec.rb +1 -1
  65. data/spec/unit/axiom/optimizer/algebra/restriction/predicate_spec.rb +5 -4
  66. data/spec/unit/axiom/optimizer/algebra/restriction/{order_operand → sorted_operand}/optimizable_predicate_spec.rb +3 -3
  67. data/spec/unit/axiom/optimizer/algebra/restriction/{order_operand → sorted_operand}/optimize_spec.rb +1 -1
  68. data/spec/unit/axiom/optimizer/algebra/summarization/empty_operand/class_methods/extension_default_spec.rb +1 -1
  69. data/spec/unit/axiom/optimizer/algebra/summarization/{order_operand → sorted_operand}/optimizable_predicate_spec.rb +3 -3
  70. data/spec/unit/axiom/optimizer/algebra/summarization/{order_operand → sorted_operand}/optimize_spec.rb +1 -1
  71. data/spec/unit/axiom/optimizer/algebra/summarization/summarize_per_spec.rb +1 -1
  72. data/spec/unit/axiom/optimizer/function/binary/constant_operands/optimizable_predicate_spec.rb +4 -4
  73. data/spec/unit/axiom/optimizer/function/connective/conjunction/contradiction/optimizable_predicate_spec.rb +2 -2
  74. data/spec/unit/axiom/optimizer/function/connective/disjunction/tautology/optimizable_predicate_spec.rb +2 -2
  75. data/spec/unit/axiom/optimizer/function/unary/constant_operand/optimizable_predicate_spec.rb +1 -1
  76. data/spec/unit/axiom/optimizer/function/util/class_methods/max_spec.rb +1 -1
  77. data/spec/unit/axiom/optimizer/function/util/class_methods/min_spec.rb +1 -1
  78. data/spec/unit/axiom/optimizer/optimizable/optimize_spec.rb +3 -3
  79. data/spec/unit/axiom/optimizer/optimizable_predicate_spec.rb +1 -5
  80. data/spec/unit/axiom/optimizer/optimize_spec.rb +1 -5
  81. data/spec/unit/axiom/optimizer/relation/operation/binary/{order_left → sorted_left}/optimizable_predicate_spec.rb +3 -3
  82. data/spec/unit/axiom/optimizer/relation/operation/binary/{order_left → sorted_left}/optimize_spec.rb +1 -1
  83. data/spec/unit/axiom/optimizer/relation/operation/binary/{order_right → sorted_right}/optimizable_predicate_spec.rb +3 -3
  84. data/spec/unit/axiom/optimizer/relation/operation/binary/{order_right → sorted_right}/optimize_spec.rb +1 -1
  85. data/spec/unit/axiom/optimizer/relation/operation/limit/equal_limit_operand/optimize_spec.rb +2 -2
  86. data/spec/unit/axiom/optimizer/relation/operation/limit/limit_operand/optimize_spec.rb +4 -4
  87. data/spec/unit/axiom/optimizer/relation/operation/limit/unoptimized_operand/optimize_spec.rb +3 -3
  88. data/spec/unit/axiom/optimizer/relation/operation/limit/zero_limit/optimize_spec.rb +2 -2
  89. data/spec/unit/axiom/optimizer/relation/operation/offset/offset_operand/optimize_spec.rb +3 -3
  90. data/spec/unit/axiom/optimizer/relation/operation/offset/unoptimized_operand/optimize_spec.rb +3 -3
  91. data/spec/unit/axiom/optimizer/relation/operation/offset/zero_offset/optimize_spec.rb +3 -3
  92. data/spec/unit/axiom/optimizer/relation/operation/reverse/{order_operand → sorted_operand}/optimizable_predicate_spec.rb +3 -3
  93. data/spec/unit/axiom/optimizer/relation/operation/reverse/{order_operand → sorted_operand}/optimize_spec.rb +2 -2
  94. data/spec/unit/axiom/optimizer/relation/operation/reverse/unoptimized_operand/optimize_spec.rb +4 -4
  95. data/spec/unit/axiom/optimizer/relation/operation/{order → sorted}/one_limit_operand/optimizable_predicate_spec.rb +2 -2
  96. data/spec/unit/axiom/optimizer/relation/operation/{order → sorted}/one_limit_operand/optimize_spec.rb +1 -1
  97. data/spec/unit/axiom/optimizer/relation/operation/{order/order_operand → sorted/sorted_operand}/optimizable_predicate_spec.rb +4 -4
  98. data/spec/unit/axiom/optimizer/relation/operation/{order/order_operand → sorted/sorted_operand}/optimize_spec.rb +5 -5
  99. data/spec/unit/axiom/optimizer/relation/operation/{order → sorted}/unoptimized_operand/optimizable_predicate_spec.rb +2 -2
  100. data/spec/unit/axiom/optimizer/relation/operation/{order → sorted}/unoptimized_operand/optimize_spec.rb +2 -2
  101. data/spec/unit/axiom/optimizer/relation/operation/unary/{order_operand → sorted_operand}/optimizable_predicate_spec.rb +4 -4
  102. data/spec/unit/axiom/optimizer/relation/operation/unary/{order_operand → sorted_operand}/optimize_spec.rb +2 -2
  103. metadata +291 -47
  104. data/spec/support/ice_nine_config.rb +0 -6
@@ -56,8 +56,8 @@ module Axiom
56
56
  EqualOperands,
57
57
  EmptyLeft,
58
58
  EmptyRight,
59
- OrderLeft,
60
- OrderRight,
59
+ SortedLeft,
60
+ SortedRight,
61
61
  MaterializedOperands,
62
62
  UnoptimizedOperands
63
63
  )
@@ -88,7 +88,7 @@ module Axiom
88
88
  #
89
89
  # @api private
90
90
  def optimizable?
91
- left.materialized? && ! right_matching_left?
91
+ left.materialized? && !right_matching_left?
92
92
  end
93
93
 
94
94
  # Return the join of the left and right with the right restricted
@@ -131,7 +131,7 @@ module Axiom
131
131
  #
132
132
  # @api private
133
133
  def optimizable?
134
- right.materialized? && ! left_matching_right?
134
+ right.materialized? && !left_matching_right?
135
135
  end
136
136
 
137
137
  # Return the join of the left and right with the left restricted
@@ -170,8 +170,8 @@ module Axiom
170
170
  EmptyRight,
171
171
  EqualHeaders,
172
172
  DisjointHeaders,
173
- OrderLeft,
174
- OrderRight,
173
+ SortedLeft,
174
+ SortedRight,
175
175
  MaterializedOperands,
176
176
  MaterializedLeft,
177
177
  MaterializedRight,
@@ -16,7 +16,7 @@ module Axiom
16
16
  #
17
17
  # @api private
18
18
  def optimizable?
19
- left.header.empty? && ! left.kind_of?(Axiom::Relation::Empty)
19
+ left.header.empty? && !left.kind_of?(Axiom::Relation::Empty)
20
20
  end
21
21
 
22
22
  # A Product with a left TABLE DEE is equivalent to the right operand
@@ -39,7 +39,7 @@ module Axiom
39
39
  #
40
40
  # @api private
41
41
  def optimizable?
42
- right.header.empty? && ! right.kind_of?(Axiom::Relation::Empty)
42
+ right.header.empty? && !right.kind_of?(Axiom::Relation::Empty)
43
43
  end
44
44
 
45
45
  # A Product with a right TABLE DEE is equivalent to the left operand
@@ -58,8 +58,8 @@ module Axiom
58
58
  TableDeeRight,
59
59
  EmptyLeft,
60
60
  EmptyRight,
61
- OrderLeft,
62
- OrderRight,
61
+ SortedLeft,
62
+ SortedRight,
63
63
  MaterializedOperands,
64
64
  UnoptimizedOperands
65
65
  )
@@ -152,10 +152,10 @@ module Axiom
152
152
 
153
153
  end # class UnionOperand
154
154
 
155
- # Optimize when the operand is an Order
156
- class OrderOperand < self
157
- include Relation::Operation::Unary::OrderOperand
158
- end # class OrderOperand
155
+ # Optimize when the operand is an Sorted
156
+ class SortedOperand < self
157
+ include Relation::Operation::Unary::SortedOperand
158
+ end # class SortedOperand
159
159
 
160
160
  # Optimize when the operand is Empty
161
161
  class EmptyOperand < self
@@ -200,7 +200,7 @@ module Axiom
200
200
  ProjectionOperand,
201
201
  ExtensionOperand,
202
202
  UnionOperand,
203
- OrderOperand,
203
+ SortedOperand,
204
204
  EmptyOperand,
205
205
  MaterializedOperand,
206
206
  UnoptimizedOperand
@@ -135,7 +135,7 @@ module Axiom
135
135
  #
136
136
  # @api private
137
137
  def alias_names
138
- aliases.to_hash.values.map { |attribute| attribute.name }
138
+ aliases.to_hash.values.map(&:name)
139
139
  end
140
140
 
141
141
  # Returns the attributes removed from the projection
@@ -249,31 +249,31 @@ module Axiom
249
249
 
250
250
  end # class ReverseOperand
251
251
 
252
- # Optimize when the operand is an Order
253
- class OrderOperand < self
254
- include Relation::Operation::Unary::OrderOperand
252
+ # Optimize when the operand is an Sorted
253
+ class SortedOperand < self
254
+ include Relation::Operation::Unary::SortedOperand
255
255
 
256
- # Wrap the Rename in an Order
256
+ # Wrap the Rename in an Sorted
257
257
  #
258
- # @return [Order]
258
+ # @return [Sorted]
259
259
  #
260
260
  # @api private
261
261
  def optimize
262
- wrap_operand.sort_by { directions }
262
+ wrap_operand.sort_by(directions)
263
263
  end
264
264
 
265
265
  private
266
266
 
267
267
  # Return the renamed directions
268
268
  #
269
- # @return [Relation::Operation::Order::DirectionSet]
269
+ # @return [Relation::Operation::Sorted::DirectionSet]
270
270
  #
271
271
  # @api private
272
272
  def directions
273
273
  operand.directions.rename(aliases)
274
274
  end
275
275
 
276
- end # class OrderOperand
276
+ end # class SortedOperand
277
277
 
278
278
  # Optimize when the operand is a Limit
279
279
  class LimitOperand < self
@@ -367,7 +367,7 @@ module Axiom
367
367
  RestrictionOperand,
368
368
  SetOperand,
369
369
  ReverseOperand,
370
- OrderOperand,
370
+ SortedOperand,
371
371
  LimitOperand,
372
372
  OffsetOperand,
373
373
  EmptyOperand,
@@ -6,6 +6,7 @@ module Axiom
6
6
 
7
7
  # Abstract base class representing Restriction optimizations
8
8
  class Restriction < Relation::Operation::Unary
9
+ include AbstractType
9
10
 
10
11
  # The optimized predicate
11
12
  #
@@ -206,9 +207,7 @@ module Axiom
206
207
  # raised when the subclass does not implement the method
207
208
  #
208
209
  # @api private
209
- def relation_method
210
- raise NotImplementedError, "#{self.class}#relation_method must be implemented"
211
- end
210
+ abstract_method :relation_method
212
211
 
213
212
  # Restrict the left operand with the left predicate partition
214
213
  #
@@ -325,10 +324,10 @@ module Axiom
325
324
 
326
325
  end # class SetOperand
327
326
 
328
- # Optimize when the operand is an Order
329
- class OrderOperand < self
330
- include Relation::Operation::Unary::OrderOperand
331
- end # class OrderOperand
327
+ # Optimize when the operand is an Sorted
328
+ class SortedOperand < self
329
+ include Relation::Operation::Unary::SortedOperand
330
+ end # class SortedOperand
332
331
 
333
332
  # Optimize when operand is optimizable
334
333
  class UnoptimizedOperand < self
@@ -340,7 +339,7 @@ module Axiom
340
339
  #
341
340
  # @api private
342
341
  def optimizable?
343
- super || ! predicate.equal?(operation.predicate)
342
+ super || !predicate.equal?(operation.predicate)
344
343
  end
345
344
 
346
345
  # Return a Restriction with an optimized operand
@@ -361,7 +360,7 @@ module Axiom
361
360
  JoinOperand,
362
361
  ProductOperand,
363
362
  SetOperand,
364
- OrderOperand,
363
+ SortedOperand,
365
364
  EmptyOperand,
366
365
  MaterializedOperand,
367
366
  UnoptimizedOperand
@@ -135,10 +135,10 @@ module Axiom
135
135
 
136
136
  end # class EmptySummarizePer
137
137
 
138
- # Optimize when the operand is an Order
139
- class OrderOperand < self
140
- include Relation::Operation::Unary::OrderOperand
141
- end # class OrderOperand
138
+ # Optimize when the operand is an Sorted
139
+ class SortedOperand < self
140
+ include Relation::Operation::Unary::SortedOperand
141
+ end # class SortedOperand
142
142
 
143
143
  # Optimize when operand is optimizable
144
144
  class UnoptimizedOperand < self
@@ -172,7 +172,7 @@ module Axiom
172
172
  #
173
173
  # @api private
174
174
  def summarize_per_optimizable?
175
- ! summarize_per.equal?(operation.summarize_per)
175
+ !summarize_per.equal?(operation.summarize_per)
176
176
  end
177
177
 
178
178
  # Test if the summarizers are optimizable
@@ -181,7 +181,7 @@ module Axiom
181
181
  #
182
182
  # @api private
183
183
  def summarizers_optimizable?
184
- ! summarizers.eql?(operation.summarizers)
184
+ !summarizers.eql?(operation.summarizers)
185
185
  end
186
186
 
187
187
  end # class UnoptimizedOperand
@@ -189,7 +189,7 @@ module Axiom
189
189
  Axiom::Algebra::Summarization.optimizer = chain(
190
190
  EmptyOperand,
191
191
  EmptySummarizePer,
192
- OrderOperand,
192
+ SortedOperand,
193
193
  MaterializedOperand,
194
194
  UnoptimizedOperand
195
195
  )
@@ -56,8 +56,8 @@ module Axiom
56
56
  EqualOperands,
57
57
  EmptyRight,
58
58
  EmptyLeft,
59
- OrderLeft,
60
- OrderRight,
59
+ SortedLeft,
60
+ SortedRight,
61
61
  MaterializedOperands,
62
62
  UnoptimizedOperands
63
63
  )
@@ -59,9 +59,8 @@ module Axiom
59
59
  #
60
60
  # @api private
61
61
  def self.min(operand)
62
- case operand
63
- when Attribute::String then operand.min_length
64
- when Attribute::Numeric then operand.range.first
62
+ if operand.respond_to?(:range)
63
+ operand.range.first
65
64
  else
66
65
  operand
67
66
  end
@@ -73,9 +72,8 @@ module Axiom
73
72
  #
74
73
  # @api private
75
74
  def self.max(operand)
76
- case operand
77
- when Attribute::String then operand.max_length
78
- when Attribute::Numeric then operand.range.last
75
+ if operand.respond_to?(:range)
76
+ operand.range.last
79
77
  else
80
78
  operand
81
79
  end
@@ -105,7 +105,7 @@ module Axiom
105
105
  #
106
106
  # @api private
107
107
  def left_optimizable?
108
- ! left.equal?(operation.left)
108
+ !left.equal?(operation.left)
109
109
  end
110
110
 
111
111
  # Test if the right operand is optimizable
@@ -114,7 +114,7 @@ module Axiom
114
114
  #
115
115
  # @api private
116
116
  def right_optimizable?
117
- ! right.equal?(operation.right)
117
+ !right.equal?(operation.right)
118
118
  end
119
119
 
120
120
  end # module UnoptimizedOperands
@@ -160,7 +160,7 @@ module Axiom
160
160
  #
161
161
  # @api private
162
162
  def optimize
163
- Axiom::Function::Proposition.new(super)
163
+ Axiom::Function::Proposition.coerce(super)
164
164
  end
165
165
 
166
166
  end # class ConstantOperands
@@ -42,7 +42,7 @@ module Axiom
42
42
  #
43
43
  # @api private
44
44
  def optimize
45
- Axiom::Function::Proposition.new(super)
45
+ Axiom::Function::Proposition.coerce(super)
46
46
  end
47
47
 
48
48
  end # class ConstantOperand
@@ -18,7 +18,7 @@ module Axiom
18
18
  #
19
19
  # @api private
20
20
  def optimize
21
- Axiom::Function::Proposition.new(super)
21
+ Axiom::Function::Proposition.coerce(super)
22
22
  end
23
23
 
24
24
  end # class ConstantOperands
@@ -46,7 +46,7 @@ module Axiom
46
46
  elsif util.constant?(left) then left_invalid_constant?
47
47
  elsif util.constant?(right) then right_invalid_constant?
48
48
  else
49
- ! joinable?
49
+ !joinable?
50
50
  end
51
51
  end
52
52
 
@@ -67,7 +67,7 @@ module Axiom
67
67
  #
68
68
  # @api private
69
69
  def left_invalid_constant?
70
- ! right.valid_value?(left)
70
+ !right.include?(left)
71
71
  end
72
72
 
73
73
  # Test if the right operand is an invalid constant
@@ -76,7 +76,7 @@ module Axiom
76
76
  #
77
77
  # @api private
78
78
  def right_invalid_constant?
79
- ! left.valid_value?(right)
79
+ !left.include?(right)
80
80
  end
81
81
 
82
82
  # Test if the left and right operand are joinable
@@ -103,7 +103,7 @@ module Axiom
103
103
  if util.constant?(left) then left_invalid_constant?
104
104
  elsif util.constant?(right) then right_invalid_constant?
105
105
  else
106
- ! comparable?
106
+ !comparable?
107
107
  end
108
108
  end
109
109
 
@@ -115,7 +115,8 @@ module Axiom
115
115
  #
116
116
  # @api private
117
117
  def left_invalid_constant?
118
- ! right.valid_primitive?(left)
118
+ type = right.type
119
+ !type.infer(left.class).equal?(type)
119
120
  end
120
121
 
121
122
  # Test if the right operand is an invalid constant
@@ -124,7 +125,8 @@ module Axiom
124
125
  #
125
126
  # @api private
126
127
  def right_invalid_constant?
127
- ! left.valid_primitive?(right)
128
+ type = left.type
129
+ !type.infer(right.class).equal?(type)
128
130
  end
129
131
 
130
132
  # Test if the left and right operand are comparable
@@ -72,9 +72,9 @@ module Axiom
72
72
  #
73
73
  # @api private
74
74
  def normalized_right_enumerable
75
- enumerable = operation.right.select { |value| left.valid_value?(value) }
75
+ enumerable = operation.right.select(&left.method(:include?))
76
76
  enumerable.uniq!
77
- enumerable.sort_by! { |value| Enumerable.sort_by_value(value) }
77
+ enumerable.sort_by!(&Enumerable.method(:sort_by_value))
78
78
  end
79
79
 
80
80
  # Optimize when the right operand is empty
@@ -67,7 +67,7 @@ module Axiom
67
67
  #
68
68
  # @api private
69
69
  def optimizable?
70
- ! operand.equal?(operation.operand)
70
+ !operand.equal?(operation.operand)
71
71
  end
72
72
 
73
73
  # Return a Aggregate with an optimized operand
@@ -53,19 +53,19 @@ module Axiom
53
53
 
54
54
  end # module EmptyRight
55
55
 
56
- # Optimize when the left operand is an Order
57
- class OrderLeft < self
56
+ # Optimize when the left operand is an Sorted
57
+ class SortedLeft < self
58
58
 
59
- # Test if the left operand is an Order
59
+ # Test if the left operand is an Sorted
60
60
  #
61
61
  # @return [Boolean]
62
62
  #
63
63
  # @api private
64
64
  def optimizable?
65
- left.kind_of?(Axiom::Relation::Operation::Order)
65
+ left.kind_of?(Axiom::Relation::Operation::Sorted)
66
66
  end
67
67
 
68
- # Drop the Order and wrap the left operand
68
+ # Drop the Sorted and wrap the left operand
69
69
  #
70
70
  # @return [Binary]
71
71
  #
@@ -74,21 +74,21 @@ module Axiom
74
74
  operation.class.new(left.operand, right)
75
75
  end
76
76
 
77
- end # class OrderLeft
77
+ end # class SortedLeft
78
78
 
79
- # Optimize when the right operand is an Order
80
- class OrderRight < self
79
+ # Optimize when the right operand is an Sorted
80
+ class SortedRight < self
81
81
 
82
- # Test if the right operand is an Order
82
+ # Test if the right operand is an Sorted
83
83
  #
84
84
  # @return [Boolean]
85
85
  #
86
86
  # @api private
87
87
  def optimizable?
88
- right.kind_of?(Axiom::Relation::Operation::Order)
88
+ right.kind_of?(Axiom::Relation::Operation::Sorted)
89
89
  end
90
90
 
91
- # Drop the Order and wrap the right operand
91
+ # Drop the Sorted and wrap the right operand
92
92
  #
93
93
  # @return [Binary]
94
94
  #
@@ -97,7 +97,7 @@ module Axiom
97
97
  operation.class.new(left, right.operand)
98
98
  end
99
99
 
100
- end # class OrderRight
100
+ end # class SortedRight
101
101
 
102
102
  # Optimize when the operands are Materialized
103
103
  class MaterializedOperands < self