Google Cloud SQL - slow INSERT performance

Viewed 1658

In a table with 10 columns, no indexes except the primary key on a single numeric column, and a single INSERT INTO statement with 2,500 rows, it takes between 40 to 60 seconds to do the insert (single transaction ... approx 40 seconds at 1:00 AM and 60 seconds during normal business hours).

I'm using com.mysql.jdbc.GoogleDriver and a D0 instance.

I find it strange that when i use the local dev environment and connect remotely through it, using the same code exactly (only diff is remote connection) those same inserts only take about 10 seconds rather than 40 to 60 seconds. So something is slowing down a lot when it moves to app engine...

Is there any way to improve the App Engine deployed performance?

EDIT: I've just added code examples. Note that when running the dev server and accessing cloud SQL, this runs pretty quickly (10 seconds in last test).

Here is the create table statement:

CREATE TABLE import_test ( import_test_ID bigint NOT NULL COMMENT 'AUTOKEY' , INDEX (import_test_ID) , first_name varchar(30) COMMENT '' , last_name varchar(30) COMMENT '' , address varchar(60) COMMENT '' , city varchar(30) COMMENT '' , state varchar(10) COMMENT '' , zip varchar(15) COMMENT '' ,  PRIMARY KEY (import_test_ID)  ) COMMENT '' 

and the very long insert (approx 3,100 rows) which I've trimmed down here:

INFO: INSERT INTO import_test (import_test_ID, first_name, last_name, address, city, state, zip) VALUES (?,?,?,?,?,?,?), (?,?,?,?,?,?,?), (?,?,?,?,?,?,?), (?,?,?,?,?,?,?), ... 
1 Answers
Related