FAQ item 4.7 discusses table size computations.   My guess is that it is
the 36 bytes-per-row that is the problem.  Those bytes record the
visibility of the row for proper transactions semantics and MVCC.


> Bruce,
> 
> I have your book right in front of me... do you have that information in the
> book?  If not, I will take a look at the FAQ.  As for mySQL, here are the
> storage requirements:
> 
> Storage requirements for numeric types
> 
> Column type   Storage required
> TINYINT               1 byte
> SMALLINT              2 bytes
> MEDIUMINT             3 bytes
> INT                   4 bytes
> INTEGER               4 bytes
> BIGINT                8 bytes
> FLOAT(X)              4 if X <= 24 or 8 if 25 <= X <= 53
> FLOAT                 4 bytes
> DOUBLE                8 bytes
> DOUBLE PRECISION      8 bytes
> REAL                  8 bytes
> DECIMAL(M,D)  M+2 bytes if D > 0, M+1 bytes if D = 0 (D+2, if M < D)
> NUMERIC(M,D)  M+2 bytes if D > 0, M+1 bytes if D = 0 (D+2, if M < D)
> 
> Storage requirements for date and time types
> 
> Column type           Storage required
> DATE                  3 bytes
> DATETIME              8 bytes
> TIMESTAMP             4 bytes
> TIME                  3 bytes
> YEAR                  1 byte
> 
> Storage requirements for string types
> 
> Column type           Storage required
> 
> CHAR(M)               M bytes, 1 <= M <= 255
> VARCHAR(M)            L+1 bytes, where L <= M and 1 <= M <= 255
> TINYBLOB,
> TINYTEXT              L+1 bytes, where L < 2^8
> BLOB, TEXT            L+2 bytes, where L < 2^16
> MEDIUMBLOB,
> MEDIUMTEXT            L+3 bytes, where L < 2^24
> LONGBLOB,
> LONGTEXT              L+4 bytes, where L < 2^32
> ENUM('value1','value2',...) 1 or 2 bytes, depending on the number of
> enumeration values (65535 values maximum)
> SET('value1','value2',...) 1, 2, 3, 4 or 8 bytes, depending on the number of
> set members (64 members maximum)
> 
> Fred
> 
> -----Original Message-----
> From: Bruce Momjian [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 27, 2001 1:48 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [GENERAL] PostgreSQL and mySQL database size question
> 
> 
> Did you see the FAQ items on estimating database sizes?  Does MySQL have
> less overhead per row?
> 
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to