|
|
 |
Re: FN-FORUM: Storing the leading 0 of product codes in MySQL
date posted 11th October 2006 14:38
Quoting Paul Cooper [EMAIL REMOVED]
> Text uses less memory than numbers.
Do you have any evidence for that? It seems unlikely.
The number 123 can be stored as a binary number (01111011) in one byte.
The string "123" needs three bytes (00111101 00111110 00111111)[1].
That's a simplification that only deals with small integers. But I'm
pretty sure that most numbers can be stored far more efficiently than
their string equivalents.
Dave...
[1] Assuming ASCII (1, 2 and 3 are characters 62, 63 and 64 respectively)
--
Magnum Solutions Ltd
Open Source Consultancy, Development and Training
http://mag-sol.com/
|
 |
|