Re: int Versus decimal

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



INT only uses 4 bytes because it doesn't have the precision that DECIMAL
has. How are you hoping to maintain the same precision when converting back
and forth?

By the way, if your column uses a precision up to 9 digits (decimal), it
will only use 5 bytes.


--
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--


"Herb Ray" <herb@xxxxxxxxx> wrote in message
news:JzfWe.170$Zl2.10211487@xxxxxxxxxxxxxxxxx
> Howdy - -
>
> I have to keep time series on large amounts of numeric data (millions
> of rows). I had the idea of storing these data as int and converting to
> decimal in views; this way, my numeric columns shrink down to four bytes
> from 9 bytes.
>
> Would the performance gained be an improvement even with the conversion
> overhead of the view?
>
> - - Herb


.



Relevant Pages

  • Re: test whether a double is even?
    ... > On my machine an int is 32 bits, so I would lose precision by converting ... Your original question was about testing a number if it's ... course you may loose precision casting a big number to int, short, or char, ...
    (comp.programming)
  • Re: Linux oddity
    ... > When converting a double to an int, ... > I'd expect on Linux: ... cases and 64 bit precision in the later case. ...
    (comp.lang.cpp)
  • Re: 12 hour clock and offset problem
    ... not violate precision in time based on precise longitude location. ... even more complex if adjustment is made including seconds. ... is lessened by use of the int() function within perl core. ...
    (comp.lang.perl.misc)
  • Re: double to int conversion yields strange results
    ... giving me two different values for the int. ... the question raised is not about the precision of the ... is done in extended precision. ... It is the conversion to 'double' before the conversion to 'int' that ...
    (comp.lang.c)
  • Re: PRI* considered harmful
    ... modified by a length modifier, suitable for use within the format ... for int, but only if "%ld" actually works with an int32_t or int ... typedef names for typedefs with base integer types. ... your original code was converting a time_t to int32_t in the first ...
    (comp.std.c)