Re: max length of sql select statement ? - Mailing list pgsql-sql

From scott.marlowe
Subject Re: max length of sql select statement ?
Date
Msg-id Pine.LNX.4.33.0307100921140.10734-100000@css120.ihs.com
Whole thread Raw
In response to max length of sql select statement ?  (markus brosch <"brosch [@] gmx [dot] de"@mail.bgm-gmbh.de>)
List pgsql-sql
On 7 Jul 2003, markus brosch wrote:

> Hi All!
> 
> I was searching the archive and was wondering why nobody asked this
> strange question (or I've not found it?):
> 
> "What is the max allowed length of a sql statement or query?"
> I want to combine hundrets or thousands 'OR' within a select statement.
> Possible or not?

the maximum length is not limited.  i.e.

insert into table badabing values ('10 gig text field goes here');

is legal and will work assuming your machine can handle such a large field 
size.  i.e. a pentium 100 with 64 meg ram, 64 meg swap and a 500 meg hard 
drive can't handle it because of hardware limits, but a Sun E10k with 64 
Gigs ram, 64 CPUs, and a 2200 gig raid array likely would.

How many OR statements can be handled is probably limited by some internal 
counter or something.  More than likely long before the database has 
"issues" with too many OR statements, you'll have issues with the 
performance (i.e. a non-linear performance curve is likely to exist as you 
start swapping out or something like that.)

I'd say experiment and see where postgresql starts to have issues.  I'd 
certainly like to know too.

I know that dozens or even hundreds of or terms are possible, thousands, 
not so sure.



pgsql-sql by date:

Previous
From: Jonathan Gardner
Date:
Subject: Re: help yourself by helping others
Next
From: "scott.marlowe"
Date:
Subject: Re: substr_count