Class: Locomotive::RelationalAlgebra::QueryPlanBundle

Inherits:
Object
  • Object
show all
Includes:
XML
Defined in:
lib/locomotive/relational_algebra/query_information.rb

Constant Summary collapse

XML_Prolog =
'<?xml version="1.0" encoding="UTF-8"?>'+"\n"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from XML

included, #quote

Constructor Details

#initialize(qin, type) ⇒ QueryPlanBundle

Returns a new instance of QueryPlanBundle.



635
636
637
638
639
640
641
642
643
644
645
646
647
648
# File 'lib/locomotive/relational_algebra/query_information.rb', line 635

def initialize(qin, type)
  plan = qin.plan
  cols = qin.column_structure
  side = qin.side_effects.plan
  surr = qin.surrogates

  ser = SerializeRelation.new(
          side, plan,
          Iter.new(1), Pos.new(1),
          cols.items)

  qp = QueryPlan.new(ser, cols, 0, type)
  self.query_plans = [qp, collect_surrogates(cols.items, 0, surr)].flatten
end

Instance Attribute Details

#cs_structureObject (readonly)

Returns the value of attribute cs_structure.



633
634
635
# File 'lib/locomotive/relational_algebra/query_information.rb', line 633

def cs_structure
  @cs_structure
end

#query_plansObject

Returns the value of attribute query_plans.



632
633
634
# File 'lib/locomotive/relational_algebra/query_information.rb', line 632

def query_plans
  @query_plans
end

Instance Method Details

#cloneObject



659
660
661
# File 'lib/locomotive/relational_algebra/query_information.rb', line 659

def clone
  QueryPlanBundle.new( logical_query_plans )
end

#to_xmlObject



650
651
652
653
654
655
656
657
# File 'lib/locomotive/relational_algebra/query_information.rb', line 650

def to_xml
  XML_Prolog +
  query_plan_bundle do
    query_plans.map do |qp|
      qp.to_xml
    end.join
  end
end