Exemple #1
0
void CreateIndex::executePlanOperation() {
  const auto& in = input.getTable(0);
  std::shared_ptr<storage::AbstractIndex> _index;
  auto column = _field_definition[0];
  auto c_store = std::dynamic_pointer_cast<const storage::Store>(in);
  auto store = std::const_pointer_cast<storage::Store>(c_store);

  CreateIndexFunctor fun(in, column, _index_name);
  storage::type_switch<hyrise_basic_types> ts;
  _index = ts(in->typeOfColumn(column), fun);

  auto sm = io::StorageManager::getInstance();
  sm->addInvertedIndex(_index_name, _index);

  if (store)
    store->addMainIndex(_index, _field_definition);
}
Exemple #2
0
void CreateIndex::executePlanOperation() {
  const auto &in = input.getTable(0);
  std::shared_ptr<hyrise::storage::AbstractIndex> _index;
  auto column = _field_definition[0];

  storage::type_switch<hyrise_basic_types> ts;

  if (_index_type == "paged") {
    CreatePagedIndexFunctor fun(in, column, _index_paged_page_size);
    _index = ts(in->typeOfColumn(column), fun);
  } else { // if (_index_type == "inverted")
    CreateIndexFunctor fun(in, column);
    _index = ts(in->typeOfColumn(column), fun);
  }

  auto sm = io::StorageManager::getInstance();
  sm->addInvertedIndex(_index_name, _index);
}