[Answered ]-Most efficient way to store a 5 point scale in Django

2👍

✅

You can go one smaller and use a PositiveSmallIntegerField, which is guaranteed in all databases to store all integers from 0 to 32,767 (i.e. the positive range of a signed short).

The ideal answer for storage optimization would be to use something like a bit field where you can store scores in binary, but there is no field type like that in built-in Django that represents numerical values. You’d have to make your own Field that stores a 3-bit unsigned integer, with entails all of the appropriate development required to glue it into Django’s ORM.

Leave a comment