Skip to content

Is there anyway to do a select_related() to prevent additional database hit #75

@ericel

Description

@ericel

I want to get the voters of an instance. That way I will check in the frontend if has already voted and displayed a UI according to that status.
But getting the review.votes.user_ids() results in additional database hit.
How to get this value without some additional database hits?

I tweaked my app, for now, to use prefetch_related('votes'). But this will still result in a 1-time additional database hit.
I want to avoid that altogether if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions