In MySQL I have 6 tables all contains the Latitude and Longitude columns. am doing Geo calculations it giving better performance but in online some article suggest me to go with separate table for Latitude and Longitude and connects that id into all my tables.i tried with small amount of the data not have any difference in the performance but i need some joins for select also need to implement relationship during the CUD (Create, Update,Delete). any one can suggest me the way ?
Asked
Active
Viewed 83 times
1 Answers
0
Factoring coordinate data out into a dedicated table is good for certain situations and bad for others. It really depends on what you're doing with the data.
Is it useful to you for different entities, in the same or different tables, to reference the same coordinates? Is it ever necessary to update the same coordinates for different entities? Then a single coordinate table will help you do that more efficiently and reliably. If there's no sharing of coordinates, then it'll be less helpful and is likely not worth the additional complexity.

dmfay
- 2,417
- 1
- 11
- 22
-
Introducing ids is not normalization. – philipxy Dec 07 '16 at 19:38
-
@philipxy Consolidating similar data inlined in multiple sources to an independent single source, however, is. – dmfay Dec 07 '16 at 19:47
-
No, that is not normalization. Normalization decomposes a table to others that join to it while reducing intra-table anomalies. Adding an id as a duplicate or replacement PK/UNIQUE or FK never introduces intra-table anomalies. Changes here involve dropping columns after adding ids but there's no decomposition let alone normalization. Even if you think of dropping columns as decomposition, it's FK-related inter-table redundancies/constraints that the dropping eliminates. No normalization. [Replacing subtuples by ids is a kind of data compression.](http://stackoverflow.com/a/32151278/3404097) – philipxy Dec 07 '16 at 23:06