Re: Having MANY MANY empty columns in database

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Having MANY MANY empty columns in database
Дата
Msg-id 47E4C231.20302@postnewspapers.com.au
обсуждение исходный текст
Ответ на Having MANY MANY empty columns in database  ("sathiya psql" <sathiya.psql@gmail.com>)
Ответы Re: Having MANY MANY empty columns in database  ("sathiya psql" <sathiya.psql@gmail.com>)
Список pgsql-performance
> In a database which we are having we have nearly 100 tables, and in 75% of
> the tables we have 6 columns ( INT ) as standard columns. What is standard
> columns, if you create a table in this database you should have some default
> 6 columns in there they should maintain
>     1. who is the owner of that read
>     2. when it is added
>     3. who is updating the record
>     4. when it is updated .... and other columns....

OK, so your tables all have the same fields (columns), as if you used
CREATE TABLE new_table ( LIKE some_template_table ) ?

> But many of the users are not doing anything with those columns, they are
> all empty always....

meaning that they contain NULL values in that field for every record?

> If you drop those columns we will gain any performance or not.....

The best way to find that out is to test it. I'd be surprised if it
didn't make *some* performance difference, but the question is whether
it will be enough to be worth caring about.

However, I recall hearing that PostgreSQL keeps a null bitmap and
doesn't use any storage for null fields. If that is correct then you
probably won't be paying much of a price in disk I/O, but there might
still be other costs.

I can't help wondering why you have all those useless columns in the
first place, and why you have so many identically structured tables.

--
Craig Ringer

В списке pgsql-performance по дате отправления:

Предыдущее
От: "sathiya psql"
Дата:
Сообщение: Having MANY MANY empty columns in database
Следующее
От: "sathiya psql"
Дата:
Сообщение: Re: Having MANY MANY empty columns in database