Ashank4vba
Programmer
Hi,
Can you help me come up with the best solution for this problem?
I have a lookup table in an Access database with some 4 million records. The table contains only 2 fields say 'a' and 'b'. I am currently searching for a value in 'a' and retrieving the corresponding value in 'b'. Both fields are indexed with duplicates allowed (There is a separate autonumber primary key). The searches have always been almost instantaneous - thankfully, untill now.
A slight modification to this is needed, wherein I need to lookup for a value which matches a part of value in field 'a' and retrieve a part of 'b'. I used 'LEFT()' and 'DISTINCT' functions and the query works fine except that it is now very slow. I need to automate this process and hence I need fast lookups. My questions are:
1)Why is this happening?
2)Should I create another table with just the part of 'a' values for this kind of lookup Or is there a better alternative?
Thanks a lot in advance.
-cheers
Ashank
[P.S: I've seen tables in some access dbs without any primary key. How is that possible? Thanks for ur ans]
Can you help me come up with the best solution for this problem?
I have a lookup table in an Access database with some 4 million records. The table contains only 2 fields say 'a' and 'b'. I am currently searching for a value in 'a' and retrieving the corresponding value in 'b'. Both fields are indexed with duplicates allowed (There is a separate autonumber primary key). The searches have always been almost instantaneous - thankfully, untill now.
A slight modification to this is needed, wherein I need to lookup for a value which matches a part of value in field 'a' and retrieve a part of 'b'. I used 'LEFT()' and 'DISTINCT' functions and the query works fine except that it is now very slow. I need to automate this process and hence I need fast lookups. My questions are:
1)Why is this happening?
2)Should I create another table with just the part of 'a' values for this kind of lookup Or is there a better alternative?
Thanks a lot in advance.
-cheers
Ashank
[P.S: I've seen tables in some access dbs without any primary key. How is that possible? Thanks for ur ans]