Hi, I think "smallint" doesn't use variable size coding, so with small values (1, 2, 3), using "int" actually saves space. If you have randomly distributed values within the range of smallint, then smallint uses less space.
Regards, Thomas On Tue, May 5, 2015 at 7:45 AM, Thomas Mueller <[email protected] <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote: > Hi, > > I would probably use INT. Small values use less space than large values, > as variable size coding is used. Performance is not affected much; INT > should be a bit faster but not much. > > Regards, > Thomas > > > On Saturday, May 2, 2015, Stig Christensen <[email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote: > >> Hi and thanks for a great database. I'm using it in a file backup >> software running embedded. >> >> Does it has any effect on the database size, choosing the right size for >> number data type? >> >> And what about performance? >> >> INT, >> TINYINT, >> SMALLINT, >> BIGINT, >> IDENTITY >> >> If INT fills up more storage than SMALLINT could I use a unsigned >> SMALLINT and load it into a Java Integer? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "H2 Database" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/h2-database. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
