Correct datatype for latitude and longitude? (in activerecord)

前端 未结 6 1363
借酒劲吻你
借酒劲吻你 2021-01-30 03:07

Should I store latitude and longitude as strings or floats (or something else)?

(I\'m using activerecord / ruby on rails, if that matters).

Update:

Mysql

6条回答
  •  无人及你
    2021-01-30 03:40

    Since they're fixed precision, you should convert and store as integer for a significant performance improvement.

    (SEE http://www.postgresql.org/docs/9.1/static/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL)

提交回复
热议问题