Quantcast
Channel: Question and Answer » postgresql
Viewing all articles
Browse latest Browse all 1138

How do completely empty columns in a large table affect performance?

$
0
0

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:

  1. How can I calculate the impact this has on storage?
    Is it equal to size of column * # of rows ?

  2. Will dropping these empty columns noticeably improve performance for this table?
    Would the page cache be able to fit more rows?


Viewing all articles
Browse latest Browse all 1138

Trending Articles