RE: query length limits - Mailing list pgsql-hackers

From Ansley, Michael
Subject RE: query length limits
Date
Msg-id 1BF7C7482189D211B03F00805F8527F70ED04E@S-NATH-EXCH2
Whole thread Raw
List pgsql-hackers
Well, this is what I have discovered so far:

I left BLCKSZ as it was, but adjusted MAX_QUERY_SIZE to 65535, and ran make.
I tried to run a 50k query, and it worked; it took a while, but the results
were fine.  So, as a temporary solution to this problem, you should be able
to set MAX_QUERY_SIZE up to what you require (don't go overboard, and please
let me know of any problems).  However, make sure that you test it properly
first, because I didn't do extensive testing, just enough to make sure that
it didn't break immediately.  Also, please remember that long queries
definitely impact the query processor, so long queries are not a great idea
for online sub-systems.  They're not great for batch either, but at least
there you have a window to play with.

More news to come.....

MikeA



>> > 
>> > Troy wrote:
>> > >>  Does Postgres have any limitations on 
>> > >>  the length of queries?
>> > >>  
>> > >>  E.g. is "select one,two,three,...thousand from 
>> one,two,three,...thousand
>> > where one = x and two is >>  x and three is x and ... 
>> thousand = x" legal?
>> > >>  
>> > Yes, there is.  It is set to BLCKSZ * 2, at least in 6.5.  
>> BLCKSZ is
>> > normally 8192 bytes, so your query size will be 16k.  
>> However, I'm busy
>> > working on it at the moment, to make it unlimited (i.e.: 
>> limited by memory
>> > available).
>> > 
>> > MikeA
>> > 
>> > 
>> 


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] Contributing
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Fix up for BTP_CHAIN problems