MySQL Forums
Forum List  »  Partitioning

Re: Partition by range for float data type column float(12,9) in mysql server 5.6
Posted by: Rick James
Date: May 17, 2015 12:04AM

Yeah, that's a dumb restriction. Complain at http://bugs.mysql.com

Meanwhile, I recommend scaling lat and lng to MEDIUMINT as demonstarted in
http://mysql.rjweb.org/doc.php/latlng

"float(12,9)" will not give you 9 decimal places. FLOAT has only 24 'significant bits', which is about 7 significant digits, including those to the left of the decimal point.

Degrees * 10000 --> MEDIUMINT gives you about the same resolution as FLOAT:
   Datatype           Bytes       resolution
   ------------------ -----  --------------------------------
   MEDIUMINT scaled       6   2.7 m    8.8 ft
   FLOAT                  8   1.7 m    5.6 ft
And MEDIUMINT can be used as the PARTITION key. (And it takes less space.)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Partition by range for float data type column float(12,9) in mysql server 5.6
1089
May 17, 2015 12:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.