From: schwarze Date: Fri, 17 Jan 2014 19:16:42 +0000 (+0000) Subject: Drop the AUTOINCREMENT PRIMARY KEYs from the mlinks and keys tables. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e3d5e84896ef8c25e7002fd72ae3893cc63143f3;p=openbsd Drop the AUTOINCREMENT PRIMARY KEYs from the mlinks and keys tables. They are completely unused, and i cannot imagine what they *could* ever be used for; but apparently, they are expensive to generate. Standard DB build time goes down by 10%, now at 1.9x of makewhatis. Standard DB size goes down by 4%, now at 11x of makewhatis. DB build time with -Q goes down by 15%, now at 0.28x of makewhatis. DB size with -Q goes down by 3%, now at 3.35x of makewhatis. Optimization found somewhere above the Southern Balochistan desert, near the Iran-Pakistan border. Committing from Melbourne, Victoria. --- diff --git a/usr.bin/mandoc/mandocdb.c b/usr.bin/mandoc/mandocdb.c index 42de78fd9b5..2c67696a3ba 100644 --- a/usr.bin/mandoc/mandocdb.c +++ b/usr.bin/mandoc/mandocdb.c @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.65 2014/01/17 19:07:12 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.66 2014/01/17 19:16:42 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -1906,16 +1906,14 @@ dbopen(int real) " \"arch\" TEXT NOT NULL,\n" " \"name\" TEXT NOT NULL,\n" " \"pageid\" INTEGER NOT NULL REFERENCES mpages(id) " - "ON DELETE CASCADE,\n" - " \"id\" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL\n" + "ON DELETE CASCADE\n" ");\n" "\n" "CREATE TABLE \"keys\" (\n" " \"bits\" INTEGER NOT NULL,\n" " \"key\" TEXT NOT NULL,\n" " \"pageid\" INTEGER NOT NULL REFERENCES mpages(id) " - "ON DELETE CASCADE,\n" - " \"id\" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL\n" + "ON DELETE CASCADE\n" ");\n"; if (SQLITE_OK != sqlite3_exec(db, sql, NULL, NULL, NULL)) {