pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
The length of the sql query
3+ messages / 2 participants
[nested] [flat]

* The length of the sql query
@ 2006-08-23 17:53  Emi Lu <emilu@encs.concordia.ca>
  0 siblings, 1 reply; 3+ messages in thread

From: Emi Lu @ 2006-08-23 17:53 UTC (permalink / raw)
  To: pgsql-sql

Hello,

Just curious to know whether postgresql has any length constraint about 
where part, such as


Query =
[
select col1, col2, ... coln
from table 1, table2,
where

constraint1 + constraint2 +................................constraintN
]

Is there any length arrange for the Query str such as 500M, 1G, etc? Or 
the query can be as long as it is.

Thanks a lot!




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: The length of the sql query
@ 2006-08-24 12:58  Emi Lu <emilu@encs.concordia.ca>
  parent: Emi Lu <emilu@encs.concordia.ca>
  0 siblings, 1 reply; 3+ messages in thread

From: Emi Lu @ 2006-08-24 12:58 UTC (permalink / raw)
  To: pgsql-sql

Hello,

It appears in MySql 3.23 the limit is 16 MB.  In 4.0 and later, it is 1 GB

http://dev.mysql.com/doc/refman/4.1/en/packet-too-large.html


Could someone tell me where I can find PostgreSQL doc about the query 
length please
Tks a lot!

> Hello,
>
> Just curious to know whether postgresql has any length constraint 
> about where part, such as
>
>
> Query =
> [
> select col1, col2, ... coln
> from table 1, table2,
> where
>
> constraint1 + constraint2 +................................constraintN
> ]
>
> Is there any length arrange for the Query str such as 500M, 1G, etc? 
> Or the query can be as long as it is.
>
> Thanks a lot!
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: The length of the sql query
@ 2006-08-24 14:34  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Emi Lu <emilu@encs.concordia.ca>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2006-08-24 14:34 UTC (permalink / raw)
  To: emilu@encs.concordia.ca; +Cc: pgsql-sql

Emi Lu <emilu@encs.concordia.ca> writes:
> Could someone tell me where I can find PostgreSQL doc about the query 
> length please

The theoretical limit is 1Gb (because palloc won't allow creation of a
longer string than that).  The practical limit is probably a great deal
less, especially if you don't have a 64-bit machine with gobs of memory,
because the query text itself is hardly the major consumer of memory
for any real-world query.

Your question is really entirely meaningless when you haven't specified
exactly what sort of query you're thinking of or what kind of platform
you intend to try to run it on.

The 1Gb upper limit for MySQL is a pretty academic number too, for
exactly the same reasons.  Have you tried putting a 1Gb query string
into MySQL?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-08-24 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-08-23 17:53 The length of the sql query Emi Lu <emilu@encs.concordia.ca>
2006-08-24 12:58 ` Emi Lu <emilu@encs.concordia.ca>
2006-08-24 14:34   ` Tom Lane <tgl@sss.pgh.pa.us>

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