cshin9
cshin9

Reputation: 1490

Best way to insert CSV in Google Cloud SQL?

I have a very large CSV file (>1 GB) and a Google Cloud SQL table to move this into. Will the graphical interface be able to handle import quickly? LOAD DATA INFILE is not supported, so is there another way to move a large CSV? The source data is in text only, and not from another MySQL.

Upvotes: 1

Views: 7523

Answers (2)

Francisco Azeredo
Francisco Azeredo

Reputation: 31

You can pull the data into the local drive, and then use the command LOAD DATA FILE. See thread below:

Import CSV file from Google Cloud Storage to Google Cloud SQL

Upvotes: 0

Vadim
Vadim

Reputation: 5126

Yes, the import via the Cloud Console will offer you the best performance.

I suggest doing the follow to obtain the best performance:

  • Turn off binary logs in instance settings, if you don't need them
  • (First Gen Only) Switch from Synchronous to Asynchronous writes in instance settings (you can switch back after the import)
  • If possible, make sure the data in the import file is sorted in primary key order

Upvotes: 4

Related Questions