Is it possible to use a primary key to avoid duplicates? The reaction to duplicate rows will depend on what type of statement you are issuing. An update/delete would update/delete all rows that are relevant, a select would return multiple rows with the same values.
-----Original Message----- From: Axel IS Main [mailto:[EMAIL PROTECTED] Sent: Sunday, March 21, 2004 10:25 PM To: [EMAIL PROTECTED] Subject: Preventing Duplicate Entries I have a php app that updates an ever growing table with new information on a regular basis. Very often the information is duplicated. I'm currently handling this by checking the table for duplicate values every time I go to add new data. As you can imagine, as the table grows it takes longer and longer for this to happen, and the process gets slower and slower. In order to speed things up I'm wondering of it might not be a good idea to not allow duplication in a given field. The question is, if there is a duplicate, how will MySQL react? And what's the best way to manage that reaction? Also, will this actually be faster than doing it the way I'm doing it now? Nick -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]