This is a discussion on Best way to Do this within the MySQL forums, part of the Database Server Software category; --> I have an addresses table with currently 850,000 records. In my application, to check for duplicates before entering it ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have an addresses table with currently 850,000 records. In my application, to check for duplicates before entering it into the database, I'm doing a select on all the fields with the data I'm about to enter. If it is found, then I do not insert the record, but rather just return the id for my app. Currently the only field that is indexed is the id field. This query is taking about 2 seconds to complete. So now I'm trying to find the best way and fastest way to check for duplicates. I thought about: 1.) Indexing every field (line1, line2, city, state, zip, country) 2.) Creating a hash of the values and adding the hashed value in another column and just index that column 3.) make every field a unique index and use REPLACE INTO instead of INSERT What are your thougths? Is there's a better way to do this? Thanks for your help. |
| Thread Tools | |
| Display Modes | |
|
|