List:General Discussion« Previous MessageNext Message »
From:Alec.Cawley Date:August 25 2005 8:44am
Subject:Re: INSERT IGNORE Doesn't Seem To Work
View as plain text  
Hal Vaughan <hal@stripped> wrote on 24/08/2005 17:41:36:

#> 
> Okay, so INSERT IGNORE only works if I am avoiding duplicate keys.  Is 
there 
> any way to use INSERT the way I thought INSERT IGNORE worked -- in other 

> words is there any keyword for the INSERT command to keep it from 
duplicating 
> rows if there isn't a key?

I don't think so. But may I inquire why you do not want to have a key? 
What you are saying is "How can I do a job without using the tool designed 
for the job?". If there is no key, in order to do what you want, MySQL 
would have to do a linear search through the table in order to check for 
duplicates - the kind of lengthy operation it is designed to avoid 
whenever possible. The key is a necessary part of the effect you want to 
achieve.

        Alec



Thread
INSERT IGNORE Doesn't Seem To WorkHal Vaughan24 Aug
  • Re: INSERT IGNORE Doesn't Seem To WorkJohan Höök24 Aug
  • Re: INSERT IGNORE Doesn't Seem To WorkAlec.Cawley24 Aug
  • Re: INSERT IGNORE Doesn't Seem To WorkHal Vaughan24 Aug
    • Re: INSERT IGNORE Doesn't Seem To WorkSGreen24 Aug
    • Re: INSERT IGNORE Doesn't Seem To WorkAlec.Cawley25 Aug
      • Re: INSERT IGNORE Doesn't Seem To WorkHal Vaughan26 Aug
        • Re: INSERT IGNORE Doesn't Seem To WorkPeter Brawley26 Aug