I have a large table (~2 million rows), each row of which represents one image. I want to store the EXIF metadata in JSON format for each image. This JSON blob is about 6KB per image.
This EXIF metadata won’t be queried/used very often, and I’m wondering whether it’d be significantly more efficient to store it in a separate table with two columns (imageid, exifjson), or whether PostgreSQL will deal with this just fine as a text column on existing table. I wouldn’t want adding the column to significantly slow down ordinary queries on the table, or the millions of 6KB text values to bog PostgreSQL down.
I would make that column TOAST-ed.
PostgreSQL already try to use it for data larger than ~2kB.
[1] “The compression technique used is a fairly simple and very fast member of the LZ family of compression techniques.”