Fossil SCM

Run "analyze" after a rebuild. For small repositories, the time doesn't matter and for large repositories, the effect on the query plans are huge. Push/pull for example will otherwise do a sequential scan of the blob table and joining that with the unclustered table afterwards, when the other way around is several order of magnitudes more efficient.

joerg 2013-01-18 21:34 trunk
Commit 80bf94e0f7ea9eb64ad9c35ed61863d73160767e
1 file changed +3
--- src/rebuild.c
+++ src/rebuild.c
@@ -614,10 +614,13 @@
614614
}
615615
if( activateWal ){
616616
db_multi_exec("PRAGMA journal_mode=WAL;");
617617
}
618618
}
619
+ fossil_print("Analyzing the database... "); fflush(stdout);
620
+ db_multi_exec("analyze");
621
+ fossil_print("done\n");
619622
if( showStats ){
620623
static struct { int idx; const char *zLabel; } aStat[] = {
621624
{ CFTYPE_ANY, "Artifacts:" },
622625
{ CFTYPE_MANIFEST, "Manifests:" },
623626
{ CFTYPE_CLUSTER, "Clusters:" },
624627
--- src/rebuild.c
+++ src/rebuild.c
@@ -614,10 +614,13 @@
614 }
615 if( activateWal ){
616 db_multi_exec("PRAGMA journal_mode=WAL;");
617 }
618 }
 
 
 
619 if( showStats ){
620 static struct { int idx; const char *zLabel; } aStat[] = {
621 { CFTYPE_ANY, "Artifacts:" },
622 { CFTYPE_MANIFEST, "Manifests:" },
623 { CFTYPE_CLUSTER, "Clusters:" },
624
--- src/rebuild.c
+++ src/rebuild.c
@@ -614,10 +614,13 @@
614 }
615 if( activateWal ){
616 db_multi_exec("PRAGMA journal_mode=WAL;");
617 }
618 }
619 fossil_print("Analyzing the database... "); fflush(stdout);
620 db_multi_exec("analyze");
621 fossil_print("done\n");
622 if( showStats ){
623 static struct { int idx; const char *zLabel; } aStat[] = {
624 { CFTYPE_ANY, "Artifacts:" },
625 { CFTYPE_MANIFEST, "Manifests:" },
626 { CFTYPE_CLUSTER, "Clusters:" },
627

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button