SQL Thought

Associate
Joined
25 Aug 2008
Posts
947
Hi,

Working on a large scale database and had the following thought...

When storing items such as postcode, would it be better to store it in stages?

Like TD 15 5BY OR TD15 5BY or TD155BY


I'm trying to create a coordinate system, that given latt/long it will spit out a list of results giving the postcode.

So i could have the table:-
Code:
CREATE TABLE postcode
{
     P1 varchar(2),
     p2 Int,
     p3 varchar(3)
}
and search :-
Code:
SELECT * 
FROM postcode
WHERE P1='EH'
AND P2=15

or have the following table:-
Code:
CREATE TABLE postcode
{
     P1 varchar(7)
}
and the following search

Code:
SELECT * 
FROM postcode
WHERE P1 CONTAINS ('"EH15*" ')

I might just end up running tests to find out which is more efficient...
 
So my answer is a question: How are you going to use the data?

I'm working on an interlaced website with google maps to place its own dataset on top of the map, given latt/long coordinates...

Users should be able to syphon the information they want to search for/find.

Bar that I dont really want to give away more of what I am building for.

I intend to run tests on various setups to check the bandwith/response times, was just wondering anyones general opinion on the construction of the underlying database.
 
Back
Top Bottom