Fossil SCM
Only run ANALYZE if the --analyze flag is provided to "fossil rebuild" or "fossil all rebuild".
Commit
3104348ec53e67005bee166a403018374f143617
Parent
4ddd099b573e401…
2 files changed
+1
+8
-3
+1
| --- src/allrepo.c | ||
| +++ src/allrepo.c | ||
| @@ -144,10 +144,11 @@ | ||
| 144 | 144 | collect_argument(&extra, "compress"); |
| 145 | 145 | collect_argument(&extra, "noverify"); |
| 146 | 146 | collect_argument_value(&extra, "pagesize"); |
| 147 | 147 | collect_argument(&extra, "vacuum"); |
| 148 | 148 | collect_argument(&extra, "deanalyze"); |
| 149 | + collect_argument(&extra, "analyze"); | |
| 149 | 150 | collect_argument(&extra, "wal"); |
| 150 | 151 | collect_argument(&extra, "stat"); |
| 151 | 152 | }else if( strncmp(zCmd, "sync", n)==0 ){ |
| 152 | 153 | zCmd = "sync -autourl -R"; |
| 153 | 154 | collect_argument(&extra, "verbose"); |
| 154 | 155 |
| --- 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 @@ | ||
| 524 | 524 | ** --noverify Skip the verification of changes to the BLOB table |
| 525 | 525 | ** --pagesize N Set the database pagesize to N. (512..65536 and power of 2) |
| 526 | 526 | ** --randomize Scan artifacts in a random order |
| 527 | 527 | ** --vacuum Run VACUUM on the database after rebuilding |
| 528 | 528 | ** --deanalyze Remove ANALYZE tables from the database |
| 529 | +** --analyze Run ANALYZE on the database after rebuilding | |
| 529 | 530 | ** --wal Set Write-Ahead-Log journalling mode on the database |
| 530 | 531 | ** --stats Show artifact statistics after rebuilding |
| 531 | 532 | ** |
| 532 | 533 | ** See also: deconstruct, reconstruct |
| 533 | 534 | */ |
| @@ -540,19 +541,21 @@ | ||
| 540 | 541 | const char *zPagesize; |
| 541 | 542 | int newPagesize = 0; |
| 542 | 543 | int activateWal; |
| 543 | 544 | int runVacuum; |
| 544 | 545 | int runDeanalyze; |
| 546 | + int runAnalyze; | |
| 545 | 547 | int runCompress; |
| 546 | 548 | int showStats; |
| 547 | 549 | |
| 548 | 550 | omitVerify = find_option("noverify",0,0)!=0; |
| 549 | 551 | forceFlag = find_option("force","f",0)!=0; |
| 550 | 552 | randomizeFlag = find_option("randomize", 0, 0)!=0; |
| 551 | 553 | doClustering = find_option("cluster", 0, 0)!=0; |
| 552 | 554 | runVacuum = find_option("vacuum",0,0)!=0; |
| 553 | 555 | runDeanalyze = find_option("deanalyze",0,0)!=0; |
| 556 | + runAnalyze = find_option("analyze",0,0)!=0; | |
| 554 | 557 | runCompress = find_option("compress",0,0)!=0; |
| 555 | 558 | zPagesize = find_option("pagesize",0,1); |
| 556 | 559 | showStats = find_option("stats",0,0)!=0; |
| 557 | 560 | if( zPagesize ){ |
| 558 | 561 | newPagesize = atoi(zPagesize); |
| @@ -605,22 +608,24 @@ | ||
| 605 | 608 | } |
| 606 | 609 | if( runDeanalyze ){ |
| 607 | 610 | db_multi_exec("DROP TABLE IF EXISTS sqlite_stat1;" |
| 608 | 611 | "DROP TABLE IF EXISTS sqlite_stat3;"); |
| 609 | 612 | } |
| 613 | + if( runAnalyze ){ | |
| 614 | + fossil_print("Analyzing the database... "); fflush(stdout); | |
| 615 | + db_multi_exec("ANALYZE;"); | |
| 616 | + fossil_print("done\n"); | |
| 617 | + } | |
| 610 | 618 | if( runVacuum ){ |
| 611 | 619 | fossil_print("Vacuuming the database... "); fflush(stdout); |
| 612 | 620 | db_multi_exec("VACUUM"); |
| 613 | 621 | fossil_print("done\n"); |
| 614 | 622 | } |
| 615 | 623 | if( activateWal ){ |
| 616 | 624 | db_multi_exec("PRAGMA journal_mode=WAL;"); |
| 617 | 625 | } |
| 618 | 626 | } |
| 619 | - fossil_print("Analyzing the database... "); fflush(stdout); | |
| 620 | - db_multi_exec("analyze"); | |
| 621 | - fossil_print("done\n"); | |
| 622 | 627 | if( showStats ){ |
| 623 | 628 | static struct { int idx; const char *zLabel; } aStat[] = { |
| 624 | 629 | { CFTYPE_ANY, "Artifacts:" }, |
| 625 | 630 | { CFTYPE_MANIFEST, "Manifests:" }, |
| 626 | 631 | { CFTYPE_CLUSTER, "Clusters:" }, |
| 627 | 632 |
| --- 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 |