Currently, the sha256 column of the checksum table in Debsources' Postgres DB
has type character varying(64):
sha256 | character varying(64) | not null
Such a data type is wasteful in terms of disk space. And it shows:
debsources=> select count(*) from checksums;
count
----------
41151812
public | checksums | table | debsources | 4890 MB |
We should switch to a more economic (and efficient) data type for storing
sha256 checksums. Good options seem to be either bytea [1] or fixed-size bit
strings [2]. Suggestions welcome!
A good, concrete way to help with this bug would be providing sample SQL
snippets to create temporary tables with the new data types, and convert /
inject into them the content of the current checksum table. That would allow to
easily benchmark disk usage and query/index efficiency.
Cheers.
[1]: http://www.postgresql.org/docs/9.4/static/datatype-binary.html#AEN5497
[2]: http://www.postgresql.org/docs/9.4/static/datatype-bit.html