table size is bigger than expected

Поиск
Список
Период
Сортировка
От Jian Shi
Тема table size is bigger than expected
Дата
Msg-id 68B6AA6E4AA4D840865FAB5BEC6707C108183089@UNIATLEX2010.unitrends.com
обсуждение исходный текст
Ответы Re: table size is bigger than expected  (Justin Pitts <justinpitts@gmail.com>)
Re: table size is bigger than expected  (Steve Crawford <scrawford@pinpointresearch.com>)
Список pgsql-performance

Hey,

 

  I’m a new user of PostgreSQL. I found one of my tables is taking unexpectedly large space:

 

select pg_size_pretty(pg_relation_size('archive_files'));                                                                     

 pg_size_pretty

----------------

1113 MB

The structure of this table is like:

   Column   |       Type        | Modifiers

------------+-------------------+-----------

archive_id | integer           | not null

dir_no     | integer           | not null

fname      | character varying | not null

type       | smallint          | not null

size       | bigint            | not null

mod_date   | integer           | not null

blocks     | bigint            | not null

blk_offset | bigint            | not null

 

the field “fname” stores file names without any directory names. In our case, each record is expected to take around 300 bytes.

 

However, this table contains 934829 records, which means each record takes about 1.2KB.

 

I did vaccum, reindex, the size is still the same. Is there anything else that I can do?

 

Thanks!

 

John

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

Предыдущее
От: Samuel Gendler
Дата:
Сообщение: Re: Need to tune for Heavy Write
Следующее
От: Claire Chang
Дата:
Сообщение: Postgres 8.4 memory related parameters