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); }
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); }
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); }
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); }
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); }
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); }
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); }