Skip to content
Browse files

running the count() query is painfully slow. Indexing a few fields to…

… try and improve
  • Loading branch information...
1 parent 6898946 commit 571124f2d6acb0c0190be01c3c134e3c4185d9ca @jedwood jedwood committed Sep 4, 2012
Showing with 7 additions and 7 deletions.
  1. +5 −5 models/biz.js
  2. +2 −2 models/exclusion.js
View
10 models/biz.js
@@ -30,11 +30,11 @@ var bizSchema = new mongoose.Schema({
emall: String,
tof: String,
minc: String,
- women: {type: Boolean, default: false},
- veteran: {type: Boolean, default: false},
- dav: {type: Boolean, default: false},
- vietnam: {type: Boolean, default: false},
- rgstrtnccrind: {type: Boolean, default: false},
+ women: {type: Boolean, default: false, index: true},
+ veteran: {type: Boolean, default: false, index: true},
+ dav: {type: Boolean, default: false, index: true},
+ vietnam: {type: Boolean, default: false, index: true},
+ rgstrtnccrind: {type: Boolean, default: false, index: true},
buslastupdtdt: Date,
latlon: Array,
View
4 models/exclusion.js
@@ -2,7 +2,7 @@ var mongoose = require('mongoose');
var schema = new mongoose.Schema({
classification: String,
- name: String,
+ name: {type: String, index: true},
prefix: String,
first: String,
middle: String,
@@ -16,7 +16,7 @@ var schema = new mongoose.Schema({
state_province: String,
country: String,
zip_code: String,
- duns: String,
+ duns: {type: String, index: true},
exclusion_program: String,
exclusion_agency: String,
ct_code: String,

0 comments on commit 571124f

Please sign in to comment.
Something went wrong with that request. Please try again.