Unix Technical Forum

Best way to Do this

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 ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 10:30 AM
Jeremi
 
Posts: n/a
Default Best way to Do this

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:12 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com