From bde6b6e5fe1b391dac65511440cb88c4501b17c6 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 6 Jan 2014 03:02:46 +0000 Subject: Drop Nd from the mpages table, it is still in the keys table. This shrinks the database in standard mode by 3%, in -Q mode by 9%, without loss of functionality. --- mandocdb.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'mandocdb.c') diff --git a/mandocdb.c b/mandocdb.c index bacc04e4..2c23c586 100644 --- a/mandocdb.c +++ b/mandocdb.c @@ -1736,7 +1736,6 @@ dbindex(const struct mpage *mpage, struct mchars *mc) { struct mlink *mlink; struct str *key; - const char *desc; int64_t recno; size_t i; unsigned int slot; @@ -1747,20 +1746,9 @@ dbindex(const struct mpage *mpage, struct mchars *mc) if (nodb) return; - desc = ""; - if (NULL != mpage->desc && '\0' != *mpage->desc) { - key = ohash_find(&strings, - ohash_qlookup(&strings, mpage->desc)); - assert(NULL != key); - if (NULL == key->rendered) - render_key(mc, key); - desc = key->rendered; - } - SQL_EXEC("BEGIN TRANSACTION"); i = 1; - SQL_BIND_TEXT(stmts[STMT_INSERT_PAGE], i, desc); SQL_BIND_INT(stmts[STMT_INSERT_PAGE], i, FORM_SRC == mpage->form); SQL_STEP(stmts[STMT_INSERT_PAGE]); recno = sqlite3_last_insert_rowid(db); @@ -1897,7 +1885,6 @@ dbopen(int real) } sql = "CREATE TABLE \"mpages\" (\n" - " \"desc\" TEXT NOT NULL,\n" " \"form\" INTEGER NOT NULL,\n" " \"id\" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL\n" ");\n" @@ -1933,7 +1920,7 @@ prepare_statements: sql = "DELETE FROM mpages where file=?"; sqlite3_prepare_v2(db, sql, -1, &stmts[STMT_DELETE_PAGE], NULL); sql = "INSERT INTO mpages " - "(desc,form) VALUES (?,?)"; + "(form) VALUES (?)"; sqlite3_prepare_v2(db, sql, -1, &stmts[STMT_INSERT_PAGE], NULL); sql = "INSERT INTO mlinks " "(file,sec,arch,name,pageid) VALUES (?,?,?,?,?)"; -- cgit