Re: Very long SQL strings - Mailing list pgsql-performance

From Heikki Linnakangas
Subject Re: Very long SQL strings
Date
Msg-id 467AC673.6080107@enterprisedb.com
Whole thread Raw
In response to Very long SQL strings  ("Steven Flatt" <steven.flatt@gmail.com>)
List pgsql-performance
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 new multi-row VALUES
> clause or SELECT ... UNION ALL to group together tuples.  Is it always
> better to group as many together as possible?

I'm sure you'll reach a point of diminishing returns, and eventually a
ceiling where you run out of memory etc, but I don't know what the limit
would be.

The most efficient way to do bulk inserts is to stream the data with COPY.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

pgsql-performance by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Database-wide VACUUM ANALYZE
Next
From: Tom Lane
Date:
Subject: Re: Very long SQL strings