List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:March 19 2005 3:30pm
Subject:Re: 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?

The one that runs fastest in your particular situation is the one
that runs fastest in your particular situation.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com

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