Opened 5 years ago

Closed 5 years ago

#17245 closed Bug (duplicate)

IpAddressField not stored effeciently

Reported by: harm Owned by: nobody
Component: Database layer (models, ORM) Version:
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Django stores IpAddressField as a string: (mysql `ip_joined` char(15) DEFAULT NULL, )
This is not effecient, and in cases where you have a LOT of these this hurts.

Django should use an INT UNSIGNED column instead of char(15). This saves 73% storage.
(difference between a 32GB ram VPS or a 8GB VPS)

mysql provides some nice helpers for this:

mysql> SELECT INET_ATON('');
        -> 167773449


Change History (1)

comment:1 Changed 5 years ago by Aymeric Augustin

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: duplicate
Status: newclosed

See #326.

Note: See TracTickets for help on using tickets.
Back to Top