+ Start a Discussion

design question for a ranked query result project

I'm working on a project for a marketing team.  they want to match their incoming leads to a Mailing List which contains millions of records.


My question is what is the best design for performing the matching in order to minimize the number of queries.  I have address fields (street, city, state, zip), phone and company name which I can use for matching.  An address match has a high rank of 4, the phone match has a med rank of 3 and the company match has a low rank of 2.


Any ideas would be much appreciated.  Please let me know if you additional clarification is required.



Just to help out the cause, in case someone else might run into this type of issue.


Used Map datatypes to create a cube of the object IDs in question and an associated rank. This is pretty powerful and quite efficient. Using a SOQL for loop we were able to iterate through the records and apply the updates as necessary.