My Experiences with Databases & More

Oracle-MySQL-SQL SERVER-Python-Azure-AWS-Oracle Cloud-GCP etc

  • Enter your email address to follow this blog and receive notifications of new posts by email.

  • Total Views

    • 558,488 hits
  • $riram $anka


    The experiences, Test cases, views, and opinions etc expressed in this website are my own and does not reflect the views or opinions of my employer. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content.Product and company names mentioned in this website may be the trademarks of their respective owners.

MySQL Load Data Statement – Performance

Posted by Sriram Sanka on December 10, 2021


As mentioned in the MySQL Documentation here https://dev.mysql.com/doc/refman/8.0/en/load-data.html ,

The LOAD DATA statement reads rows from a text file into a table at a very high speed. The file can be read from the server host or the client host, depending on whether the LOCAL modifier is given. LOCAL also affects data interpretation and error handling.

Lets Run a Quick Test !

Loading Data Into a Table in the local Database using MySQL workbench Executed around 35Min (2098.781 Sec) for 35K records.

Now Lets Truncate the Table and re-load the data using LOAD DATA Statement

BOOM ! Job Done within 2 Sec.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: