Skip to content


Mongodb-engine not caching QuerySets? #117

ablegrape opened this Issue · 4 comments

4 participants


Something I've noticed about Mongodb-engine (or is it a general django-nonrel issue) versus the "standard" Django:

If I do:

>>> my_qs = MyClass.objects.filter(<some_very_expensive_query>)

Django comes back immediately, with or without Mongodb, because it hasn't evaluated the QuerySet yet.

Then if I do:

>>> my_result = my_qs[0]

Here, I wait a few seconds, with or without Mongodb. Again, this is expected; I forced Django to evaluate the QuerySet.

But if I then do:

>>> my_second_result = my_qs[1]

In "normal" Django, this returns immediately, since Django has already evaluated the QuerySet and cached at least a chunk of it. With mongodb-engine, I wait a few seconds again; it's clear that Django is re-evaluating the QuerySet every time I access an element.

Is this the expected behavior? If so, it seems like a serious performance problem because it breaks the expected behavior of Django. Or am I misunderstanding or doing something wrong? I couldn't find anything on the Django-nonrel group list about this, but it seems like it must be a known issue.


I can confirm this. It's definitely a bug, patches/tests welcome.


Is this bug have fixed?

Django and NoSQL member

The issue is still open, so I doubt anyone has made a fix. Are you still experiencing the issue, which version of mongodb-engine are you using?


Well no, I've not experienced this issue yet, I just see this issue. But I'll try to reproduce it. I'm using 1.5-beta also.

Thanks for your reply ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.