Fossil SCM

Only run ANALYZE if the --analyze flag is provided to "fossil rebuild" or "fossil all rebuild".

drh 2013-01-23 13:09 trunk
Commit 3104348ec53e67005bee166a403018374f143617
2 files changed +1 +8 -3
--- src/allrepo.c
+++ src/allrepo.c
@@ -144,10 +144,11 @@
144144
collect_argument(&extra, "compress");
145145
collect_argument(&extra, "noverify");
146146
collect_argument_value(&extra, "pagesize");
147147
collect_argument(&extra, "vacuum");
148148
collect_argument(&extra, "deanalyze");
149
+ collect_argument(&extra, "analyze");
149150
collect_argument(&extra, "wal");
150151
collect_argument(&extra, "stat");
151152
}else if( strncmp(zCmd, "sync", n)==0 ){
152153
zCmd = "sync -autourl -R";
153154
collect_argument(&extra, "verbose");
154155
--- src/allrepo.c
+++ src/allrepo.c
@@ -144,10 +144,11 @@
144 collect_argument(&extra, "compress");
145 collect_argument(&extra, "noverify");
146 collect_argument_value(&extra, "pagesize");
147 collect_argument(&extra, "vacuum");
148 collect_argument(&extra, "deanalyze");
 
149 collect_argument(&extra, "wal");
150 collect_argument(&extra, "stat");
151 }else if( strncmp(zCmd, "sync", n)==0 ){
152 zCmd = "sync -autourl -R";
153 collect_argument(&extra, "verbose");
154
--- src/allrepo.c
+++ src/allrepo.c
@@ -144,10 +144,11 @@
144 collect_argument(&extra, "compress");
145 collect_argument(&extra, "noverify");
146 collect_argument_value(&extra, "pagesize");
147 collect_argument(&extra, "vacuum");
148 collect_argument(&extra, "deanalyze");
149 collect_argument(&extra, "analyze");
150 collect_argument(&extra, "wal");
151 collect_argument(&extra, "stat");
152 }else if( strncmp(zCmd, "sync", n)==0 ){
153 zCmd = "sync -autourl -R";
154 collect_argument(&extra, "verbose");
155
+8 -3
--- src/rebuild.c
+++ src/rebuild.c
@@ -524,10 +524,11 @@
524524
** --noverify Skip the verification of changes to the BLOB table
525525
** --pagesize N Set the database pagesize to N. (512..65536 and power of 2)
526526
** --randomize Scan artifacts in a random order
527527
** --vacuum Run VACUUM on the database after rebuilding
528528
** --deanalyze Remove ANALYZE tables from the database
529
+** --analyze Run ANALYZE on the database after rebuilding
529530
** --wal Set Write-Ahead-Log journalling mode on the database
530531
** --stats Show artifact statistics after rebuilding
531532
**
532533
** See also: deconstruct, reconstruct
533534
*/
@@ -540,19 +541,21 @@
540541
const char *zPagesize;
541542
int newPagesize = 0;
542543
int activateWal;
543544
int runVacuum;
544545
int runDeanalyze;
546
+ int runAnalyze;
545547
int runCompress;
546548
int showStats;
547549
548550
omitVerify = find_option("noverify",0,0)!=0;
549551
forceFlag = find_option("force","f",0)!=0;
550552
randomizeFlag = find_option("randomize", 0, 0)!=0;
551553
doClustering = find_option("cluster", 0, 0)!=0;
552554
runVacuum = find_option("vacuum",0,0)!=0;
553555
runDeanalyze = find_option("deanalyze",0,0)!=0;
556
+ runAnalyze = find_option("analyze",0,0)!=0;
554557
runCompress = find_option("compress",0,0)!=0;
555558
zPagesize = find_option("pagesize",0,1);
556559
showStats = find_option("stats",0,0)!=0;
557560
if( zPagesize ){
558561
newPagesize = atoi(zPagesize);
@@ -605,22 +608,24 @@
605608
}
606609
if( runDeanalyze ){
607610
db_multi_exec("DROP TABLE IF EXISTS sqlite_stat1;"
608611
"DROP TABLE IF EXISTS sqlite_stat3;");
609612
}
613
+ if( runAnalyze ){
614
+ fossil_print("Analyzing the database... "); fflush(stdout);
615
+ db_multi_exec("ANALYZE;");
616
+ fossil_print("done\n");
617
+ }
610618
if( runVacuum ){
611619
fossil_print("Vacuuming the database... "); fflush(stdout);
612620
db_multi_exec("VACUUM");
613621
fossil_print("done\n");
614622
}
615623
if( activateWal ){
616624
db_multi_exec("PRAGMA journal_mode=WAL;");
617625
}
618626
}
619
- fossil_print("Analyzing the database... "); fflush(stdout);
620
- db_multi_exec("analyze");
621
- fossil_print("done\n");
622627
if( showStats ){
623628
static struct { int idx; const char *zLabel; } aStat[] = {
624629
{ CFTYPE_ANY, "Artifacts:" },
625630
{ CFTYPE_MANIFEST, "Manifests:" },
626631
{ CFTYPE_CLUSTER, "Clusters:" },
627632
--- src/rebuild.c
+++ src/rebuild.c
@@ -524,10 +524,11 @@
524 ** --noverify Skip the verification of changes to the BLOB table
525 ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2)
526 ** --randomize Scan artifacts in a random order
527 ** --vacuum Run VACUUM on the database after rebuilding
528 ** --deanalyze Remove ANALYZE tables from the database
 
529 ** --wal Set Write-Ahead-Log journalling mode on the database
530 ** --stats Show artifact statistics after rebuilding
531 **
532 ** See also: deconstruct, reconstruct
533 */
@@ -540,19 +541,21 @@
540 const char *zPagesize;
541 int newPagesize = 0;
542 int activateWal;
543 int runVacuum;
544 int runDeanalyze;
 
545 int runCompress;
546 int showStats;
547
548 omitVerify = find_option("noverify",0,0)!=0;
549 forceFlag = find_option("force","f",0)!=0;
550 randomizeFlag = find_option("randomize", 0, 0)!=0;
551 doClustering = find_option("cluster", 0, 0)!=0;
552 runVacuum = find_option("vacuum",0,0)!=0;
553 runDeanalyze = find_option("deanalyze",0,0)!=0;
 
554 runCompress = find_option("compress",0,0)!=0;
555 zPagesize = find_option("pagesize",0,1);
556 showStats = find_option("stats",0,0)!=0;
557 if( zPagesize ){
558 newPagesize = atoi(zPagesize);
@@ -605,22 +608,24 @@
605 }
606 if( runDeanalyze ){
607 db_multi_exec("DROP TABLE IF EXISTS sqlite_stat1;"
608 "DROP TABLE IF EXISTS sqlite_stat3;");
609 }
 
 
 
 
 
610 if( runVacuum ){
611 fossil_print("Vacuuming the database... "); fflush(stdout);
612 db_multi_exec("VACUUM");
613 fossil_print("done\n");
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
--- src/rebuild.c
+++ src/rebuild.c
@@ -524,10 +524,11 @@
524 ** --noverify Skip the verification of changes to the BLOB table
525 ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2)
526 ** --randomize Scan artifacts in a random order
527 ** --vacuum Run VACUUM on the database after rebuilding
528 ** --deanalyze Remove ANALYZE tables from the database
529 ** --analyze Run ANALYZE on the database after rebuilding
530 ** --wal Set Write-Ahead-Log journalling mode on the database
531 ** --stats Show artifact statistics after rebuilding
532 **
533 ** See also: deconstruct, reconstruct
534 */
@@ -540,19 +541,21 @@
541 const char *zPagesize;
542 int newPagesize = 0;
543 int activateWal;
544 int runVacuum;
545 int runDeanalyze;
546 int runAnalyze;
547 int runCompress;
548 int showStats;
549
550 omitVerify = find_option("noverify",0,0)!=0;
551 forceFlag = find_option("force","f",0)!=0;
552 randomizeFlag = find_option("randomize", 0, 0)!=0;
553 doClustering = find_option("cluster", 0, 0)!=0;
554 runVacuum = find_option("vacuum",0,0)!=0;
555 runDeanalyze = find_option("deanalyze",0,0)!=0;
556 runAnalyze = find_option("analyze",0,0)!=0;
557 runCompress = find_option("compress",0,0)!=0;
558 zPagesize = find_option("pagesize",0,1);
559 showStats = find_option("stats",0,0)!=0;
560 if( zPagesize ){
561 newPagesize = atoi(zPagesize);
@@ -605,22 +608,24 @@
608 }
609 if( runDeanalyze ){
610 db_multi_exec("DROP TABLE IF EXISTS sqlite_stat1;"
611 "DROP TABLE IF EXISTS sqlite_stat3;");
612 }
613 if( runAnalyze ){
614 fossil_print("Analyzing the database... "); fflush(stdout);
615 db_multi_exec("ANALYZE;");
616 fossil_print("done\n");
617 }
618 if( runVacuum ){
619 fossil_print("Vacuuming the database... "); fflush(stdout);
620 db_multi_exec("VACUUM");
621 fossil_print("done\n");
622 }
623 if( activateWal ){
624 db_multi_exec("PRAGMA journal_mode=WAL;");
625 }
626 }
 
 
 
627 if( showStats ){
628 static struct { int idx; const char *zLabel; } aStat[] = {
629 { CFTYPE_ANY, "Artifacts:" },
630 { CFTYPE_MANIFEST, "Manifests:" },
631 { CFTYPE_CLUSTER, "Clusters:" },
632

Keyboard Shortcuts

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