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