Performance on regex finds with %LIKE% semantics

242 views
Skip to first unread message

zatter99

unread,
Sep 24, 2010, 2:26:56 AM9/24/10
to mongodb-user
Hi everybody,
what is the best way of getting apprpriate find performance on such a
query

db.collection.find({name: /findstring.*/})

on a collection of more than 2M rows?

Indexes cannot be used I assume.

Michael Dirolf

unread,
Sep 24, 2010, 9:43:25 AM9/24/10
to mongod...@googlegroups.com
Correct, an index won't be used unless you to a prefix match
(/^findstring/). There's a lot of factors involved so I'd recommend
testing to see how it performs for you.

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

Andreas Jung

unread,
Sep 24, 2010, 9:47:27 AM9/24/10
to mongod...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

MongoDB does not provide a fulltext search engine.

Consider usingan external search engine like SOLR or ElasticSearch.

I think fulltext search is planned for a further release (perhaps even
for 1.8).

Right now there is no efficient way to use right truncation with
MongoDB's query capabilities (except you reimplement an indexing
structure for right truncation yourself in MongoDB).

- -aj
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJMnKvvAAoJEADcfz7u4AZjD9ILwIiVHfwcb1/+4tz9goJqvQBC
PnmJWjxdKARNTg3Yh3DrCp5dvc1COGbxPucBL0nvMB7CqMO7PV795dCYDCcOaxrK
frKDxi/+8acTQ7+T+djRooXU/eBW0bMgmthRQLW0ZryzC+AZb6VE3FOImMWFa2Ey
fnJim2Z5QAhQvzojqb9/NxRaODbmNsptgCyt/CjCZ3roUvoXu0xnVGFVDwLkLNcD
gptvbsSvGP5CZMTq5PaDuPl+Q8tUN36KEN8HODx3KzMhjKMAh+NCsgvUQBwu/e1E
Jg+DECbLFRyPY8uGugsgsITM77cjQR/+uenK89OltX0u/F5EqoOvaMjggmQF+eDh
1NpIvsw3RR9SCvS3Iybx9q0J4DWrzelyZMXXeuZb1rlo6HWjypMAKSjz9tOwmNEn
bOREw8PdE9BylbUgDLuCdfa7BBpgWdwtXUkEsE6jQZPdjE3xaz+YfpzqJNR8Kycw
w55zJdrBU4RUw7gtTXQ364lhPcfWK/M=
=sssn
-----END PGP SIGNATURE-----

lists.vcf

zatter99

unread,
Sep 24, 2010, 12:34:29 PM9/24/10
to mongodb-user
Thanks everybody. This is what I've expected.

It looks like the fulltext search is planned for.1.7.x release.
Whatever x will be ;-)

Looks like we'll have to wait until then.



On Sep 24, 3:47 pm, Andreas Jung <li...@zopyx.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> zatter99 wrote:
> > Hi everybody,
> > what is the best way of getting apprpriate find performance on such a
> > query
>
> > db.collection.find({name: /findstring.*/})
>
> > on a collection of more than 2M rows?
>
> > Indexes cannot be used I assume.
>
> MongoDB does not provide a fulltext search engine.
>
> Consider usingan external search engine like SOLR or ElasticSearch.
>
> I think fulltext search is planned for a further release (perhaps even
> for 1.8).
>
> Right now there is no efficient way to use right truncation with
> MongoDB's query capabilities (except you reimplement an indexing
> structure for right truncation yourself in MongoDB).
>
> - -aj
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (Darwin)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
>
> iQGUBAEBAgAGBQJMnKvvAAoJEADcfz7u4AZjD9ILwIiVHfwcb1/+4tz9goJqvQBC
> PnmJWjxdKARNTg3Yh3DrCp5dvc1COGbxPucBL0nvMB7CqMO7PV795dCYDCcOaxrK
> frKDxi/+8acTQ7+T+djRooXU/eBW0bMgmthRQLW0ZryzC+AZb6VE3FOImMWFa2Ey
> fnJim2Z5QAhQvzojqb9/NxRaODbmNsptgCyt/CjCZ3roUvoXu0xnVGFVDwLkLNcD
> gptvbsSvGP5CZMTq5PaDuPl+Q8tUN36KEN8HODx3KzMhjKMAh+NCsgvUQBwu/e1E
> Jg+DECbLFRyPY8uGugsgsITM77cjQR/+uenK89OltX0u/F5EqoOvaMjggmQF+eDh
> 1NpIvsw3RR9SCvS3Iybx9q0J4DWrzelyZMXXeuZb1rlo6HWjypMAKSjz9tOwmNEn
> bOREw8PdE9BylbUgDLuCdfa7BBpgWdwtXUkEsE6jQZPdjE3xaz+YfpzqJNR8Kycw
> w55zJdrBU4RUw7gtTXQ364lhPcfWK/M=
> =sssn
> -----END PGP SIGNATURE-----
>
>  lists.vcf
> < 1KViewDownload
Reply all
Reply to author
Forward
0 new messages