OK.
Now while I’ve been programming for 15 years in a preious life – I’ve only taken up MYSQL in the last 6 months – and only done a coulpe of things …
So I’ll give you my answer – but be warned I might still be talking rubbish.
:laugh:
As I understand it PRIMARY keys must be unique (otherwise the couldn’t be found on a key search) – so given the base of your discussion you sohuld consider the following.
It sounds to me like you actually have one REAL key which is a concatenation of both sub keys (key1 and key2).
You should create a UNIQUE PRMIARY key = key3 which is a combination of key1 and key2
Set up Key1 and Key2 as indexed fields. This should enable you to quickly search your database along these lines too. In fact reading the between the line it sounds like you search on these fields more often?
Your programme will need to maintain integrity (whenever Key1 or KEy2 are changed then KEy3 is aletered too.
I THINK that should work for you – if not gimme a little more detail and we should be able to work out a programmatic solution.
:thumbsup: