• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

very slow mongodb query

 
arash kolivand
Greenhorn
Posts: 5
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a database on mongodb with a collection that has a millions documents.
the document has over 150 fields, and collection.statictis() return output like this:

A simple query like this
(crc.field1>0 and crc.field1<1000 and crc.field2=1)or(crc.field1>1000 and crc.field1<2000 and crc.field2=2)
take time over 40 seconds.
what should i do?
some one help me please.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question on StackOverflow might probably be very useful. It provides an approach you could follow to determine what's causing this query to execute slowly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic