Skip site navigation (1) Skip section navigation (2)

RE: query length limits

From: "Ansley, Michael" <Michael(dot)Ansley(at)intec(dot)co(dot)za>
To: "'tjk(at)tksoft(dot)com'" <tk(at)uno(dot)tksoft(dot)com>
Cc: "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>, "'pgsql-interfaces(at)postgresql(dot)org'" <pgsql-interfaces(at)postgresql(dot)org>
Subject: RE: query length limits
Date: 1999-07-17 10:17:08
Message-ID: 1BF7C7482189D211B03F00805F8527F70ED04E@S-NATH-EXCH2 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfaces
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

Next:From: Tom LaneDate: 1999-07-17 15:15:57
Subject: Re: [HACKERS] Fix up for BTP_CHAIN problems
Previous:From: Thomas LockhartDate: 1999-07-17 06:06:02
Subject: Re: [HACKERS] Contributing

pgsql-interfaces by date

Next:From: Tom LaneDate: 1999-07-17 15:57:27
Subject: Re: [INTERFACES] Postgres 6.5 and PQsetdb(,,"-F",,)
Previous:From: Jean-Denis GirardDate: 1999-07-17 08:27:35
Subject: Postgres 6.5 and PQsetdb(,,"-F",,)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group