Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

$all with only one item is equivalent with normal search right?

Here is the log without $all (I used 4700 test cases with 30 thread):

Thu Sep 20 17:27:05 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^emic/ } ntoreturn:20 reslen:20 404ms
Thu Sep 20 17:27:05 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^jakarta/ } ntoreturn:20 nreturned:20 reslen:1193 67ms
Thu Sep 20 17:27:05 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^sap/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1138 219ms
Thu Sep 20 17:27:05 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^ione/ } ntoreturn:20 reslen:20 326ms
Thu Sep 20 17:27:05 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^phi/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1210 340ms
Thu Sep 20 17:27:05 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^dentist/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1074 252ms
Thu Sep 20 17:27:05 [conn23] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^othe/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1048 113ms
Thu Sep 20 17:27:05 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^kota/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1147 296ms
Thu Sep 20 17:27:05 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^budi/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1068 250ms
Thu Sep 20 17:27:05 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^atc/ } ntoreturn:20 reslen:20 364ms
Thu Sep 20 17:27:06 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^mir/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1055 275ms
Thu Sep 20 17:27:06 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^mogo/ } ntoreturn:20 nscanned:6 nreturned:6 reslen:347 325ms
Thu Sep 20 17:27:06 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^pondok/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:993 184ms
Thu Sep 20 17:27:06 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^aneka/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1114 257ms
Thu Sep 20 17:27:06 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^tv/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1154 173ms
Thu Sep 20 17:27:06 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^t/ } ntoreturn:20 nreturned:20 reslen:1085 3ms
Thu Sep 20 17:27:06 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^system/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1271 177ms
Thu Sep 20 17:27:06 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^crepes/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1134 302ms
Thu Sep 20 17:27:06 [conn23] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^factor/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1324 340ms
Thu Sep 20 17:27:06 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^baso/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1214 239ms
Thu Sep 20 17:27:06 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^forward/ } ntoreturn:20 nreturned:20 reslen:1351 52ms
Thu Sep 20 17:27:06 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^permai/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1268 318ms
Thu Sep 20 17:27:06 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^eam/ } ntoreturn:20 reslen:20 311ms
Thu Sep 20 17:27:06 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^elf/ } ntoreturn:20 nscanned:1 nreturned:1 reslen:80 319ms
Thu Sep 20 17:27:06 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^anugrah/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1191 279ms
Thu Sep 20 17:27:07 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^mac/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1234 282ms
Thu Sep 20 17:27:07 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^happy/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1153 298ms
Thu Sep 20 17:27:07 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^warding/ } ntoreturn:20 reslen:20 408ms
Thu Sep 20 17:27:07 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^g/ } ntoreturn:20 nreturned:20 reslen:1220 3ms
Thu Sep 20 17:27:07 [conn23] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^otak/ } ntoreturn:20 nscanned:3 nreturned:3 reslen:204 336ms
Thu Sep 20 17:27:07 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^nail/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1226 312ms
Thu Sep 20 17:27:07 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^apotik/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:977 195ms
Thu Sep 20 17:27:07 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^kare/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1116 295ms
Thu Sep 20 17:27:07 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^king/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1131 252ms
Thu Sep 20 17:27:07 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^modern/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1069 252ms
Thu Sep 20 17:27:07 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^dutamas/ } ntoreturn:20 nscanned:6 nreturned:6 reslen:396 326ms
Thu Sep 20 17:27:07 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^course/ } ntoreturn:20 nscanned:20 nreturned:20 reslen:1185 237ms
Thu Sep 20 17:27:07 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: /^elle/ } ntoreturn:20 nscanned:3 nreturned:3 reslen:180 349ms
Thu Sep 20 17:27:07 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.000785114234121064

Here is the result if using $all

hu Sep 20 16:51:32 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^ykai/ ] } } ntoreturn:20 reslen:20 1712ms
Thu Sep 20 16:51:33 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^mnctv/ ] } } ntoreturn:20 reslen:20 1543ms
Thu Sep 20 16:51:33 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^edric/ ] } } ntoreturn:20 reslen:20 1378ms
Thu Sep 20 16:51:33 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^emobile/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:68 1435ms
Thu Sep 20 16:51:33 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^foodfes/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:73 1657ms
Thu Sep 20 16:51:33 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^consys/ ] } } ntoreturn:20 reslen:20 1698ms
Thu Sep 20 16:51:33 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^nokiaw/ ] } } ntoreturn:20 reslen:20 1747ms
Thu Sep 20 16:51:33 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^elf/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:80 1572ms
Thu Sep 20 16:51:33 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^rmhku/ ] } } ntoreturn:20 reslen:20 1553ms
Thu Sep 20 16:51:34 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^refly/ ] } } ntoreturn:20 reslen:20 1768ms
Thu Sep 20 16:51:34 [conn23] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^yuanita/ ] } } ntoreturn:20 reslen:20 1913ms
Thu Sep 20 16:51:34 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^mediate/ ] } } ntoreturn:20 nscanned:2 nreturned:2 reslen:103 1543ms
Thu Sep 20 16:51:34 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^diskus/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:70 1411ms
Thu Sep 20 16:51:34 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^rico/ ] } } ntoreturn:20 nscanned:8 nreturned:8 reslen:486 1748ms
Thu Sep 20 16:51:34 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^bismart/ ] } } ntoreturn:20 reslen:20 1643ms
Thu Sep 20 16:51:35 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^livera/ ] } } ntoreturn:20 reslen:20 1502ms
Thu Sep 20 16:51:35 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^kikirna/ ] } } ntoreturn:20 reslen:20 1693ms
Thu Sep 20 16:51:35 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^factor/ ] } } ntoreturn:20 nscanned:20 nreturned:20 reslen:1324 1161ms
Thu Sep 20 16:51:35 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^haytien/ ] } } ntoreturn:20 reslen:20 1679ms
Thu Sep 20 16:51:35 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^harni/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:86 1994ms
Thu Sep 20 16:51:36 [conn23] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^otak/ ] } } ntoreturn:20 nscanned:3 nreturned:3 reslen:204 1912ms
Thu Sep 20 16:51:36 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^bluenet/ ] } } ntoreturn:20 reslen:20 1598ms
Thu Sep 20 16:51:36 [conn21] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^topwan/ ] } } ntoreturn:20 reslen:20 1549ms
Thu Sep 20 16:51:36 [conn15] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^tobas/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:54 1596ms
Thu Sep 20 16:51:36 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^imagen/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:55 1595ms
Thu Sep 20 16:51:36 [conn9] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^corocot/ ] } } ntoreturn:20 nscanned:2 nreturned:2 reslen:128 1280ms
Thu Sep 20 16:51:36 [conn13] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^pdor/ ] } } ntoreturn:20 reslen:20 1682ms
Thu Sep 20 16:51:36 [conn20] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^elcom/ ] } } ntoreturn:20 nscanned:1 nreturned:1 reslen:63 1865ms
Thu Sep 20 16:51:37 [conn11] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^delapan/ ] } } ntoreturn:20 nscanned:6 nreturned:6 reslen:358 1740ms
Thu Sep 20 16:51:37 [conn7] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^tato/ ] } } ntoreturn:20 nscanned:13 nreturned:13 reslen:863 1678ms
Thu Sep 20 16:51:37 [conn23] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^mac/ ] } } ntoreturn:20 nscanned:20 nreturned:20 reslen:1234 1197ms
Thu Sep 20 16:51:37 [conn5] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^dutamas/ ] } } ntoreturn:20 nscanned:6 nreturned:6 reslen:396 1455ms
Thu Sep 20 16:51:37 [conn16] query newisikotagte15.tablebusiness query: { LongitudeLatitude: { $nearSphere: [ 106.8317, -6.2426 ], $maxDistance: 0.0007851142341210646 }, indexWords: { $all: [ /^jeneiro/ ] } } ntoreturn:20 reslen:20 1466ms

Note: I am aware that using $all for just one word is kind of useless, and that's the point. I use one word to show that the problem is not on indexing, or the query it self. In the future obviously I will use $all for 2 - 3 keywords. However, in this sample, I use just one words so that it's obvious that the problem is not in the fact that the result is different but something more fundamental.

$in is not problematic.

share|improve this question
    
I may be missing something here, but how can you compare the two if you're using completely different search terms for with and without $all? –  Phil Sep 20 '12 at 11:33

1 Answer 1

Using $all doesn't make much sense for a single value match, but I assume you are just doing that for simplicity. Doing multiple regex matches (even simple prefix matches) on an array of values may not be fantastic for performance concerns either.

However, there is an unresolved issue for performance problems with $all that may apply here:

https://jira.mongodb.org/browse/SERVER-1748

share|improve this answer
    
Yes obviously I want to do $all with possibly more than 1 word. I use one word in this sample to show that something is really wrong on mongodb side. Any query optimizer worth it's salt should be able to see that the query is equivalent. –  Jim Thio Sep 21 '12 at 4:11
    
the optimizer in MongoDB is really (currently) just about picking the best indexes, it won't alter the query being done to make it faster. –  Adam C Sep 21 '12 at 9:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.