2
* Copyright (C) 2008 10gen Inc.
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU Affero General Public License, version 3,
6
* as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Affero General Public License for more details.
13
* You should have received a copy of the GNU Affero General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
#include "mongo/db/extsort.h"
23
/** for bottom up fastbuildindex (where we presort keys) */
30
shared_ptr<BSONObjExternalSorter> sorter;
31
unsigned long long n; // # of records
32
unsigned long long nkeys;
33
bool multi; // multikey index
35
void addKeys(const IndexSpec& spec, const BSONObj& o, DiskLoc loc) {
37
spec.getKeys(o, keys);
39
for ( BSONObjSet::iterator i=keys.begin(); i != keys.end(); i++ ) {