Simon Riggs simon at 2ndquadrant.com
Fri Oct 26 00:37:08 PDT 2007
On Thu, 2007-10-25 at 19:59 -0700, David Fetter wrote:

> Does Slony-I 2-to-be use INSERT ... VALUES (...), ..., (...); to pass
> INSERTs?  It seems to me this would be quicker than a flock of
> single-tuple INSERTs, and since we're having flag day with 8.3, we're
> guaranteed the feature is there. :)

It's not easily possible to do this because each invocation of the log
trigger has a different set of values and they can't see each others
values.

It could be possible to do this on the apply side by saving up data from
log table row to row until we can issue a single mega-INSERT. But if we
were going to do that, why not initiate a COPY, which would handle the
bulk cases even better? The difficulty would be in deciding what the
logic should be to invoke the special case SQL construction.

Another thought: I notice that Slony writes out all of the column names
for each insert e.g. (col1, col2, col3) VALUES (x, y, x)

It would be straightforward to remove the (col1, col2, col3) text from
each INSERT statement since that is optional. That would reduce the
overhead of each INSERT row and reduce the parsing time on the other
side also.

-- 
  Simon Riggs
  2ndQuadrant  http://www.2ndQuadrant.com



More information about the Slony1-general mailing list