Class: Veritas::Optimizer::Algebra::Product::TableDeeLeft

Inherits:
Veritas::Optimizer::Algebra::Product show all
Defined in:
lib/veritas/optimizer/algebra/product.rb

Overview

Optimize when left operand is a TABLE DEE

Constant Summary

Constants inherited from Veritas::Optimizer

Noop, VERSION

Instance Attribute Summary

Attributes included from Function::Binary

#left, #right

Attributes inherited from Veritas::Optimizer

#operation

Instance Method Summary collapse

Methods included from Function::Binary

#initialize

Methods inherited from Veritas::Optimizer

chain, #initialize

Instance Method Details

#optimizable?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test if the left operand is a TABLE DEE

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/veritas/optimizer/algebra/product.rb', line 18

def optimizable?
  left = self.left
  left.header.empty? && ! left.kind_of?(Veritas::Relation::Empty)
end

#optimizeRelation

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

A Product with a left TABLE DEE is equivalent to the right operand

Returns:



28
29
30
# File 'lib/veritas/optimizer/algebra/product.rb', line 28

def optimize
  right
end