Not sure what you're tyring to do here or how the postal codes are laid out in Britain, but you may want to think about prepopulating a table(s) that contain postal codes adjacent to a given postal code. That way, in real-time, you first calculate those postal codes, and then if no hit, you can calcucate all the rest. Sowls down some results, but speeds up the majority of them.
Other variations include all codes within 2 postal codes of a given code (geographically - not numerically). Or do the quick calcs on all codes within 10 numeric codes of your postal code. The object here is to do a smaller set of calcs that have a high chance of containing your results, and then do the entire set of calcs for the remainder.
Did something like this for a dispatch system once and one of the factors is the "average" distance between postal codes - in Western States, a code can cover 100's of square miles. In NYC, a couple of blocks.