Skip to content

Mongodb-engine not caching QuerySets? #117

Open
@ablegrape

Description

@ablegrape

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions