summaryrefslogtreecommitdiffstats
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-01-06 03:02:46 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-01-06 03:02:46 +0000
commitbde6b6e5fe1b391dac65511440cb88c4501b17c6 (patch)
tree17ffada1819d058aff1e45486983b8f68a6a2238 /mandocdb.c
parent0a8353f869e8d8e9772ef1e8e227f19a628994ad (diff)
downloadmandoc-bde6b6e5fe1b391dac65511440cb88c4501b17c6.tar.gz
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.
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c15
1 files changed, 1 insertions, 14 deletions
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 (?,?,?,?,?)";