If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > Strange size of the table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-02-12, 10:05
Baumi Baumi is offline
Registered User
 
Join Date: Jul 2012
Posts: 1
Question Strange size of the table

Hi,

I have a table with columns and constraints:

Code:
  height smallint,
  length smallint,
  diameter smallint,
  volume integer,
  idsensorfragments integer,
  CONSTRAINT sensorstats_idsensorfragments_fkey FOREIGN KEY (idsensorfragments)
      REFERENCES sensorfragments (idsensorfragments) MATCH SIMPLE
      ON UPDATE CASCADE ON DELETE CASCADE
(no primary key). There is currently 28 978 112 records in it, but the size of the table is way too much in my opinion.

Result of the query:

Code:
select pg_size_pretty(pg_total_relation_size('sensorstats')), pg_size_pretty(pg_relation_size('sensorstats'))
is:

Code:
"1849 MB";"1226 MB"
There is just one index on idsensorfragments column. Using simple math you can see that one record takes ~66,7 B (?!?!). Can anyone explain me where this number comes from?

5 columns = 2 + 2 + 2 + 4 + 4 = 14 Bytes. I have one index, no primary key. Where additional 50B per record comes from?

Thanks!

P.S. Table was vacuumed, analyzed and reindexed.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On