pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: scott.marlowe <scott.marlowe@ihs.com>
To: markus brosch <"brosch [@] gmx [dot] de"@mail.bgm-gmbh.de>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: max length of sql select statement ?
Date: Thu, 10 Jul 2003 09:24:39 -0600 (MDT)
Message-ID: <Pine.LNX.4.33.0307100921140.10734-100000@css120.ihs.com> (raw)
In-Reply-To: <1057590954.886.84.camel@sam>

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.




view thread (14+ messages)

Message-ID: <Pine.LNX.4.33.0307100921140.10734-100000@css120.ihs.com>
Permalink:  ../Pine.LNX.4.33.0307100921140.10734-100000@css120.ihs.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.33.0307100921140.10734-100000@css120.ihs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: scott.marlowe@ihs.com, "brosch [@] gmx [dot] de"@mail.bgm-gmbh.de
  Subject: Re: max length of sql select statement ?
  In-Reply-To: <Pine.LNX.4.33.0307100921140.10734-100000@css120.ihs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox