Improve performance by selecting only desired columns

Issue #72 wontfix
bgeneto created an issue

I think you could simply return the desired columns instead of selecting all columns from the table by changing “get_initial_queryset”to:

return self.model.objects.all().only(*self.columns)

I don't know if that change could have any side effects (besides performance improvement)…

Regards,

Bernhard Enders

Comments (1)

  1. Maciej Wisniowski repo owner

    This might be a good idea in some cases but unfortunately, this might be backward-incompatible (eg if render method uses other fields too). Because it is very easy to implement this just by overriding get_initial_queryset method I'll leave it as is.

  2. Log in to comment