I have 400 million rows in a Postgres db, and the table has 18 columns:
id serial NOT NULL,
a integer,
b integer,
c integer,
d smallint,
e timestamp without time zone,
f smallint,
g timestamp without time zone,
h integer,
i timestamp without time zone,
j integer,
k character varying(32),
l integer,
m smallint,
n smallint,
o character varying(36),
p character varying(100),
q character varying(100)
Columns e, k, and n are all NULL, they do not store any values at all and are completely useless at this point. They were part of the original design, but never removed.
Edit – most of the other columns are non-NULL.
Questions:
-
How can I calculate the impact this has on storage?
Is it equal to size of column * # of rows ? -
Will dropping these empty columns noticeably improve performance for this table?
Would the page cache be able to fit more rows?