List:General Discussion« Previous MessageNext Message »
From:Jan Pieter Kunst Date:March 19 2005 8:34am
Subject:Which one of these two queries would be fastest?
View as plain text  
Assuming everything is properly indexed.

(1) INSERT INTO my_table_1 (field1, field2) SELECT DISTINCT field1,
field2 FROM my_table_2;

or

(2) INSERT IGNORE INTO my_table_1 (field1, field2) SELECT field1,
field2 FROM my_table_2;

Is there anything to say about this in a general sense, or does it all
depend on the data in question?

Thanks,
JP
Thread
Which one of these two queries would be fastest?Jan Pieter Kunst18 Mar
  • Which one of these two queries would be fastest?Jan Pieter Kunst19 Mar
  • Re: Which one of these two queries would be fastest?Martijn Tonies19 Mar