JosephRedfern / CM2301-9

CM2301 Group Project - Decentralised Online Learning System
7 stars 2 forks source link

Inefficient counting of objects #152

Closed charlierm closed 11 years ago

charlierm commented 11 years ago

When counting the total of multiple fields we shouldn't be fetching the entire data set, for example calculating the total size of an attachment we should be using djangos aggregate query.

https://docs.djangoproject.com/en/dev/ref/models/querysets/

Then the load is on the database.

charlierm commented 11 years ago

Sorted