Page 1 of 1

Should I distribute my inserts on different nodes?

Posted: Thu Dec 04, 2014 9:24 pm
by hopewell
I have 4 nodes and 4 long running SQL insert as select statements that insert data into the same table. Each insert statement run for hours. Is it better to have 4 connections to one node where each session runs one of the insert statements, or one connection per node per insert statement?

Re: Should I distribute my inserts on different nodes?

Posted: Thu Dec 04, 2014 10:54 pm
by NorbertKrupa
What isolation level are you using? READ COMMITTED allows for concurrent INSERT statements.

Ideally, you should try to batch your loads.

Re: Should I distribute my inserts on different nodes?

Posted: Fri Dec 05, 2014 11:43 am
by id10t
Hi!

[DELETED]

Re: Should I distribute my inserts on different nodes?

Posted: Fri Dec 05, 2014 3:37 pm
by NorbertKrupa
id10t wrote:Please clarify what do you mean:
  • INSERT INTO <tbl> SELECT ... FROM
  • INSERT INTO <tbl> VALUES (...)
Great point.

Re: Should I distribute my inserts on different nodes?

Posted: Fri Dec 05, 2014 3:43 pm
by hopewell
Thanks for the responses, guys!

I am doing 4 "INSERT INTO <tbl> SELECT ... FROM" statements.

So, it's recommended that I do each insert on its own node? That makes sense.

Re: Should I distribute my inserts on different nodes?

Posted: Fri Dec 05, 2014 9:43 pm
by id10t
Hi!

[DELETED]

Re: Should I distribute my inserts on different nodes?

Posted: Fri Dec 05, 2014 10:19 pm
by hopewell
Thanks! I get it :) Makes complete sense, great explanation!