コード例 #1
0
ファイル: index_catalog.cpp プロジェクト: wy4515/peloton
bool IndexCatalog::DeleteIndex(oid_t index_oid, concurrency::Transaction *txn) {
  oid_t index_offset = 0;  // Index of index_oid
  std::vector<type::Value> values;
  values.push_back(type::ValueFactory::GetIntegerValue(index_oid).Copy());

  return DeleteWithIndexScan(index_offset, values, txn);
}
コード例 #2
0
bool IndexMetricsCatalog::DeleteIndexMetrics(concurrency::TransactionContext *txn, oid_t index_oid) {
  oid_t index_offset = IndexId::PRIMARY_KEY;  // Primary key index

  std::vector<type::Value> values;
  values.push_back(type::ValueFactory::GetIntegerValue(index_oid).Copy());

  return DeleteWithIndexScan(txn, index_offset, values);
}
コード例 #3
0
bool TableMetricsCatalog::DeleteTableMetrics(oid_t table_oid,
                                             concurrency::Transaction *txn) {
  oid_t index_offset = IndexId::PRIMARY_KEY;  // Primary key index

  std::vector<type::Value> values;
  values.push_back(type::ValueFactory::GetIntegerValue(table_oid).Copy());

  return DeleteWithIndexScan(index_offset, values, txn);
}
コード例 #4
0
ファイル: trigger_catalog.cpp プロジェクト: apavlo/peloton
bool TriggerCatalog::DeleteTriggerByName(const std::string &trigger_name,
                                         oid_t table_oid,
                                         concurrency::TransactionContext *txn) {
  oid_t index_offset = IndexId::NAME_TABLE_KEY_2;
  std::vector<type::Value> values;
  values.push_back(type::ValueFactory::GetVarcharValue(trigger_name).Copy());
  values.push_back(type::ValueFactory::GetIntegerValue(table_oid).Copy());

  return DeleteWithIndexScan(index_offset, values, txn);
}
コード例 #5
0
bool QueryMetricsCatalog::DeleteQueryMetrics(concurrency::TransactionContext *txn,
                                             const std::string &name) {
  oid_t index_offset = IndexId::PRIMARY_KEY;  // Primary key index

  std::vector<type::Value> values;
  values.push_back(type::ValueFactory::GetVarcharValue(name, nullptr).Copy());
  values.push_back(type::ValueFactory::GetIntegerValue(database_oid_).Copy());

  return DeleteWithIndexScan(txn, index_offset, values);
}
コード例 #6
0
ファイル: database_catalog.cpp プロジェクト: apavlo/peloton
bool DatabaseCatalog::DeleteDatabase(oid_t database_oid,
                                     concurrency::TransactionContext *txn) {
  oid_t index_offset = IndexId::PRIMARY_KEY;  // Index of database_oid
  std::vector<type::Value> values;
  values.push_back(type::ValueFactory::GetIntegerValue(database_oid).Copy());

  // evict cache
  txn->catalog_cache.EvictDatabaseObject(database_oid);

  return DeleteWithIndexScan(index_offset, values, txn);
}
コード例 #7
0
ファイル: index_catalog.cpp プロジェクト: cmu-db/peloton
bool IndexCatalog::DeleteIndex(concurrency::TransactionContext *txn,
                               oid_t database_oid,
                               oid_t index_oid) {
  oid_t index_offset = IndexId::PRIMARY_KEY;  // Index of index_oid
  std::vector<type::Value> values;
  values.push_back(type::ValueFactory::GetIntegerValue(index_oid).Copy());

  auto index_object = txn->catalog_cache.GetCachedIndexObject(database_oid,
                                                              index_oid);
  if (index_object) {
    auto table_object =
        txn->catalog_cache.GetCachedTableObject(database_oid,
                                                index_object->GetTableOid());
    table_object->EvictAllIndexCatalogEntries();
  }

  return DeleteWithIndexScan(txn, index_offset, values);
}