Re: [PERFORM] Very long SQL strings

2007-06-21 Thread Tom Lane
Chris Browne <[EMAIL PROTECTED]> writes: > I once ran into the situation where Slony-I generated a query that > made the parser blow out (some sort of memory problem / running out of > stack space somewhere thing); it was just short of 640K long, and so > we figured that evidently it was wrong to c

Re: [PERFORM] Very long SQL strings

2007-06-21 Thread Steven Flatt
Thanks everyone for your responses. I don't think it's realistic to change our application infrastructure to use COPY from a stream at this point. It's good to know that multi-row-VALUES is good up into the thousands of rows (depending on various things, of course). That's a good enough answer f

Re: [PERFORM] Very long SQL strings

2007-06-21 Thread Chris Browne
[EMAIL PROTECTED] (Tom Lane) writes: > PS: for the record, there is a hard limit at 1GB of query text, owing > to restrictions built into palloc. But I think you'd hit other > memory limits or performance bottlenecks before that one. It would be much funnier to set a hard limit of 640K of query t

Re: [PERFORM] Very long SQL strings

2007-06-21 Thread Andreas Kretschmer
Steven Flatt <[EMAIL PROTECTED]> schrieb: > For example, on a toy table with two columns, I noticed about a 20% increase > when bulking together 1000 tuples in one INSERT statement as opposed to doing > 1000 individual INSERTS. Would this be the same for 1? 10? Does it > depend on the wid

Re: [PERFORM] Very long SQL strings

2007-06-21 Thread Tom Lane
"Steven Flatt" <[EMAIL PROTECTED]> writes: > It looks like Postgres does not enforce a limit on the length of an SQL > string. Great. However is there some point at which a query string becomes > ridiculously too long and affects performance? Yes, but it'll depend a whole lot on context; I'd sug

Re: [PERFORM] Very long SQL strings

2007-06-21 Thread Heikki Linnakangas
Steven Flatt wrote: It looks like Postgres does not enforce a limit on the length of an SQL string. Great. However is there some point at which a query string becomes ridiculously too long and affects performance? Here's my particular case: consider an INSERT statement where you're using the

[PERFORM] Very long SQL strings

2007-06-21 Thread Steven Flatt
I can't seem to find a definitive answer to this. It looks like Postgres does not enforce a limit on the length of an SQL string. Great. However is there some point at which a query string becomes ridiculously too long and affects performance? Here's my particular case: consider an INSERT stat