Re: Improve queries on django admin

2016-07-22 Thread Tobias McNulty
I think the question was more about memory usage than speed, but the answer is the same, in my opinion. The only thing I'll add is that -- if returning a mere 100 rows of a table is really causing memory issues -- there are alternatives to storing large blobs of data directly in the DB (e.g., file

Re: Improve queries on django admin

2016-07-22 Thread Shai Berger
I tend to agree with Tim -- in particular, a query on the admin should only return a small (<100) number of records, due to paging; if, for that size of query, you see a significant difference between returning all the columns and returning just the ones you need, it is suspicious: Either you ha

Re: Improve queries on django admin

2016-07-22 Thread Tim Graham
I'm a bit wary of the complexity this would add, especially given this warning in the documentation: The defer() method (and its cousin, only() , below) are only for advanced use-cases. They provi

Re: Improve queries on django admin

2016-07-22 Thread Rael Max
Hi Lucas, thanks for reply I think that select_related gives a great improve on performance but we can improve his usage passing the columns that we want retrieve, avoiding getting most columns/data and allocate more memory than necessary. Em quinta-feira, 21 de julho de 2016 17:01:00 UTC-3, Lu

Re: Improve queries on django admin

2016-07-21 Thread Lucas Magnum
You can use `list_select_related` for Django Admin too. []'s Lucas Magnum. 2016-07-21 15:52 GMT-03:00 Rael Max : > Hi everyone, > > I'm working in a project with a large mysql database and i've faced with > problems generated on django admin list. Basically, the query executed to > retrieve

Improve queries on django admin

2016-07-21 Thread Rael Max
Hi everyone, I'm working in a project with a large mysql database and i've faced with problems generated on django admin list. Basically, the query executed to retrieve a list of items from a model uses a SQL SELECT passing a list of all attributes of model, but usually we only use a small set