Fossil SCM
Get a 10x speedup on long annotations by indexing a field in the temporary "ancestor" table.
Commit
1c40de184393c829e505d8e780c7ee961582fd11
Parent
07c8b730726d6b6…
1 file changed
+1
-1
+1
-1
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -203,11 +203,11 @@ | ||
| 203 | 203 | void compute_direct_ancestors(int rid, int N){ |
| 204 | 204 | Stmt ins; |
| 205 | 205 | Stmt q; |
| 206 | 206 | int gen = 0; |
| 207 | 207 | db_multi_exec( |
| 208 | - "CREATE TEMP TABLE IF NOT EXISTS ancestor(rid INTEGER," | |
| 208 | + "CREATE TEMP TABLE IF NOT EXISTS ancestor(rid INTEGER UNIQUE NOT NULL," | |
| 209 | 209 | " generation INTEGER PRIMARY KEY);" |
| 210 | 210 | "DELETE FROM ancestor;" |
| 211 | 211 | "INSERT INTO ancestor VALUES(%d, 0);", rid |
| 212 | 212 | ); |
| 213 | 213 | db_prepare(&ins, "INSERT INTO ancestor VALUES(:rid, :gen)"); |
| 214 | 214 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -203,11 +203,11 @@ | |
| 203 | void compute_direct_ancestors(int rid, int N){ |
| 204 | Stmt ins; |
| 205 | Stmt q; |
| 206 | int gen = 0; |
| 207 | db_multi_exec( |
| 208 | "CREATE TEMP TABLE IF NOT EXISTS ancestor(rid INTEGER," |
| 209 | " generation INTEGER PRIMARY KEY);" |
| 210 | "DELETE FROM ancestor;" |
| 211 | "INSERT INTO ancestor VALUES(%d, 0);", rid |
| 212 | ); |
| 213 | db_prepare(&ins, "INSERT INTO ancestor VALUES(:rid, :gen)"); |
| 214 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -203,11 +203,11 @@ | |
| 203 | void compute_direct_ancestors(int rid, int N){ |
| 204 | Stmt ins; |
| 205 | Stmt q; |
| 206 | int gen = 0; |
| 207 | db_multi_exec( |
| 208 | "CREATE TEMP TABLE IF NOT EXISTS ancestor(rid INTEGER UNIQUE NOT NULL," |
| 209 | " generation INTEGER PRIMARY KEY);" |
| 210 | "DELETE FROM ancestor;" |
| 211 | "INSERT INTO ancestor VALUES(%d, 0);", rid |
| 212 | ); |
| 213 | db_prepare(&ins, "INSERT INTO ancestor VALUES(:rid, :gen)"); |
| 214 |