I've created a table "global_settings" for storing different settings of a web applications -- the ones, that I want to be able to edit on html page:
global_settings:
id primary key,
key varchar(100),
value varchar(1000),
extra_data jsonb
wherein key
has been given UNIQUE
constaint.
There'll be, let's say, 100 settings at most.
However, as I've already realized, key
, at times, may reach 100 characters or so. It's because I want to make it explictly clear.
How much of additional disk space do these kinds of UNIQUE
and long keys-indexes of VARCHAR
add into a DB, on average? The size of int64
is 8 bytes, whereas this key
will be ... over 10 times bigger. Hence, over 10 times as much of a disk space. Correct?
If I were to have thousands of these, it'd have made the size of the DB 10 times bigger compared to a situation when there was a key
of int64
?