I'm trying to build a query optimizer for survey response data, all questions are stored in a collection and have some fields are number_of_selection, option_marked etc.

Now I'm trying to build a query tool where user can run query like

Q.option_marked == 1 && Q.option_marked == 2  // i.e where option_marked is 1 and 2 both
Q1 == Q2                                      // i.e all the questions where options selected are same as other

Q.option_marked == 1 || (Q1 == Q2)            // i.e. multiple conditions

Well this can be more generalized. Currently I've come across various techniques like bitmap indexing(although not supported in mongodb yet), wildcard indexing but, I cannot optimize this query as it's dynamic and question has like 10 varieties least, the survey data will be huge e.g. the CSV file is over 10GB.

Can someone guide me into the right direction?

  • 2
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Sep 7 at 5:59


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.