Answer the question
In order to leave comments, you need to log in
PostgreSQL, does it make sense to move a large column to a separate table?
There is a table with goods which contains about 50 million records, the size is about 100Gb. Postgres caches lines in RAM the first time it reads lines from disk to speed up lookups.
CREATE TABLE product (
id BIGINT PRIMARY KEY,
...
description TEXT,
);
SELECT id FROM product LIMIT 10;
Answer the question
In order to leave comments, you need to log in
The TEXT type is not stored in the table anyway, a link to it is stored. (although small sizes are sometimes stored directly in the table, implementation dependent)
Postgres should not clog memory with this. And if you separate it into the second column, then you will waste on an additional index.
This makes sense if your description is repeated for different products, as a result you can use the same description (one line) for different products.
To speed up, you need to see what queries and indexes you have.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question