List:General Discussion« Previous MessageNext Message »
From:mos Date:November 27 2009 10:20pm
Subject:Re: INSERT DATA INTO TABLE
View as plain text  
At 07:40 AM 11/27/2009, Krishna Chandra Prajapati wrote:
>Hi Experts,
>
>load data local infile and insert into <tablename> are the two methods of
>inserting data into a mysql table.
>
>Out of the above two method. Is there any faster method of inserting data
>into mysql tables.

No. Load Data is the fastest method, unless the data is already stored in 
another table.

Tip: Remember when using Load Data, it will be faster if the table is empty 
and optimized (no holes) than with a table that has data in it. That's 
because the non-unique indexes are built after all of the data has been 
loaded. The alternative is to disable the non-unique indexes prior to using 
Load Data. Unfortunately there is no way to disable the building of unique 
indexes during this process unless you remove the unique index prior to 
loading the data and building it later.

Tip: Using Insert will be much slower than Load Data but you can speed it 
up by loading dozens of rows using one Insert statement.

Hope these tips help.

Mike 

Thread
INSERT DATA INTO TABLEKrishna Chandra Prajapati27 Nov
  • Re: INSERT DATA INTO TABLEmos27 Nov
    • Re: INSERT DATA INTO TABLEKrishna Chandra Prajapati28 Nov
      • Re: INSERT DATA INTO TABLEmos28 Nov