#5091 Skip unnecessary project count queries

v1.0.0
closed
General
Cory Johns
2015-08-20
2012-10-09
No

This query takes a lot of time. It's used during project registration to enforce a max number of projects, but it scans every single project to do its counting. https://groups.google.com/d/msg/mongodb-user/8aFNkJbtDF0/TILIz_Mp8tQJ It's not necessary to do this query when the nbhd has no max limit.

                        "query" : {
                                "count" : "project",
                                "fields" : null,
                                "query" : {
                                        "deleted" : false,
                                        "is_nbhd_project" : false,
                                        "neighborhood_id" : ObjectId("4be2faf8898e33156f00003e")
                                }
                        },

Discussion

  • Dave Brondsema

    Dave Brondsema - 2012-10-09
    • status: in-progress --> code-review
    • qa: Cory Johns
     
  • Dave Brondsema

    Dave Brondsema - 2012-10-09

    allura:db/5091

    Tests in allura/tests/functional/test_neighborhood.py should cover it

     
  • Cory Johns

    Cory Johns - 2012-10-09
    • status: code-review --> closed