summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-09-26 23:47:01 -0400
committerEliot Horowitz <eliot@10gen.com>2009-09-26 23:47:01 -0400
commit5f75cfe408af147b1553df2f34ce3b50c6c8dc38 (patch)
tree8e2831bb1cf4046f48e6772421fdc2ecf2be85e5
parent20616d0565d47433b723501ef90144e7e9675770 (diff)
downloadmongo-5f75cfe408af147b1553df2f34ce3b50c6c8dc38.tar.gz
some debugging
-rw-r--r--db/pdfile.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/db/pdfile.cpp b/db/pdfile.cpp
index 47aace3c19c..4ff9eaf7d2d 100644
--- a/db/pdfile.cpp
+++ b/db/pdfile.cpp
@@ -1044,7 +1044,7 @@ assert( !eloc.isNull() );
sorter.add(x, DiskLoc(3,77));
sorter.sort();
-
+
auto_ptr<BSONObjExternalSorter::Iterator> i = sorter.iterator();
while( i->more() ) {
BSONObjExternalSorter::Data d = i->next();
@@ -1058,6 +1058,7 @@ assert( !eloc.isNull() );
*/
unsigned long long fastBuildIndex(const char *ns, NamespaceDetails *d, IndexDetails& idx, int idxNo) {
// testSorting();
+ Timer t;
log() << "Buildindex " << ns << " idxNo:" << idxNo << ' ' << idx.info.obj().toString() << endl;
@@ -1092,6 +1093,8 @@ assert( !eloc.isNull() );
};
sorter.sort();
+ log(1) << "\t external sort used : " << sorter.numFiles() << " files " << " in " << (double)t.millis() / 1000 << " secs" << endl;
+
/* if( 0 && idxNo == 1 ) {
// TEMP!
@@ -1139,7 +1142,7 @@ assert( !eloc.isNull() );
wassert( btBuilder.getn() == nkeys || dropDups );
}
- log(1) << "\t\t fastBuildIndex dupsToDrop:" << dupsToDrop.size() << endl;
+ log(1) << "\t fastBuildIndex dupsToDrop:" << dupsToDrop.size() << endl;
for( list<DiskLoc>::iterator i = dupsToDrop.begin(); i != dupsToDrop.end(); i++ )
theDataFileMgr.deleteRecord( ns, i->rec(), *i, false, true );
@@ -1177,9 +1180,7 @@ assert( !eloc.isNull() );
}
void buildIndex(string ns, NamespaceDetails *d, IndexDetails& idx, int idxNo) {
- Nullstream& l = log();
- l << "building new index on " << idx.keyPattern() << " for " << ns << "..." << endl;
- l.flush();
+ log() << "building new index on " << idx.keyPattern() << " for " << ns << "..." << endl;
Timer t;
unsigned long long n = fastBuildIndex(ns.c_str(), d, idx, idxNo);
@@ -1187,7 +1188,7 @@ assert( !eloc.isNull() );
//idx.head = BtreeBucket::addBucket(idx);
//int n = addExistingToIndex(ns.c_str(), d, idx, idxNo);
- l << "done for " << n << " records " << t.millis() / 1000.0 << "secs" << endl;
+ log() << "\t done for " << n << " records " << t.millis() / 1000.0 << "secs" << endl;
}
/* add keys to indexes for a new record */