Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Schema design for a geocoding table in SQL Server

$
0
0

I'm thinking to cache a list of addresses and their coordinates (lat + long) in SQL Server. Usually I get the coordinates by invoking a web service and in order to avoid a round trip to that WS I want to store all those WS responses in alocally SQL Server database.

I'm wondering how to optimally store WS responses in my local SQL Server database as I might have a list of 500k addresses? I was thinking to the following structure:

AddressHash BIGINT -- PK, clustered index, 
--obtained by applying a hashing algorith (SHA-1?) of
--Street|StreetNumber|Zip|City|County|Country
Lat DECIMAL 
Long DECIMAL 

1/ What do you think about?

2/ Do you recommend a better(=faster) hashing algorithm?

3/ BIGINT is an optimal datatype in this case?

4/ Do you any other optimal way to store those data in SQL Server?


SQLhint.com



Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>