From: Michael Vrable Date: Thu, 6 Dec 2007 05:27:37 +0000 (-0800) Subject: Drop the obsolete snapshot_contents table from the local database. X-Git-Url: http://git.vrable.net/?p=cumulus.git;a=commitdiff_plain;h=4a312a9c567e5acae9f58587287795e0f7b0cd6c Drop the obsolete snapshot_contents table from the local database. --- diff --git a/localdb.cc b/localdb.cc index 98b2b09..c0ad7d6 100644 --- a/localdb.cc +++ b/localdb.cc @@ -331,26 +331,11 @@ void LocalDb::UseObject(const ObjectReference& ref) int rc; sqlite3_stmt *stmt; - stmt = Prepare("insert or ignore into snapshot_contents " - "select blockid, ? as snapshotid from block_index " - "where segmentid = ? and object = ?"); - sqlite3_bind_int64(stmt, 1, snapshotid); - sqlite3_bind_int64(stmt, 2, SegmentToId(ref.get_segment())); - string obj = ref.get_sequence(); - sqlite3_bind_text(stmt, 3, obj.c_str(), obj.size(), SQLITE_TRANSIENT); - - rc = sqlite3_step(stmt); - if (rc != SQLITE_DONE) { - fprintf(stderr, "Could not execute INSERT statement!\n"); - ReportError(rc); - } - - sqlite3_finalize(stmt); - stmt = Prepare("insert or ignore into snapshot_refs " "select segmentid, object, size from block_index " "where segmentid = ? and object = ?"); sqlite3_bind_int64(stmt, 1, SegmentToId(ref.get_segment())); + string obj = ref.get_sequence(); sqlite3_bind_text(stmt, 2, obj.c_str(), obj.size(), SQLITE_TRANSIENT); rc = sqlite3_step(stmt); diff --git a/schema.sql b/schema.sql index 1c6e84e..a0556c5 100644 --- a/schema.sql +++ b/schema.sql @@ -39,11 +39,3 @@ create table segments_used ( segmentid integer not null, utilization real ); - --- Index tracking which blocks are used by which snapshots. -create table snapshot_contents ( - blockid integer, - snapshotid integer -); -create unique index snapshot_contents_unique - on snapshot_contents(blockid, snapshotid);