Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2008, 01:00 AM
Panagiotis Papadakos
 
Posts: n/a
Default Problem with very big queries.

Hello everybody.

I want to send to postgresql-8.0 a very big query,
select * from table where lala IN (....)
Inside IN there are almost 60000 values.

Unfortunately, the server terminates with a singal 11 and I get
to my console the following:

An I/O error occured while sending to the backend.
An I/O error occured while sending to the backend.

jdbc version is 8.0-322 JDBC 3.

Could anybody help?

Regards.

--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-16-2008, 01:00 AM
Panagiotis Papadakos
 
Posts: n/a
Default Re: Problem with very big queries.

On Friday 11 April 2008 02:04:42 Dave Cramer wrote:
> First you should upgrade your server to 8.0.15
>
> The server is segfaulting. The driver is just reporting that the
> server crashed.

Hi!

I am using 8.0.15 postgres server and unfortunately can't upgrade to 8.3
since I am using sp-gist tries. So, there is a limit in the allowable query
length?

Thanks.

>
> Dave
>
> On 10-Apr-08, at 6:52 PM, Panagiotis Papadakos wrote:
> > Hello everybody.
> >
> > I want to send to postgresql-8.0 a very big query,
> > select * from table where lala IN (....)
> > Inside IN there are almost 60000 values.
> >
> > Unfortunately, the server terminates with a singal 11 and I get
> > to my console the following:
> >
> > An I/O error occured while sending to the backend.
> > An I/O error occured while sending to the backend.
> >
> > jdbc version is 8.0-322 JDBC 3.
> >
> > Could anybody help?
> >
> > Regards.
> >
> > --
> > Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-jdbc




--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-16-2008, 01:00 AM
Tom Lane
 
Posts: n/a
Default Re: Problem with very big queries.

Panagiotis Papadakos <papadako@csd.uoc.gr> writes:
> I want to send to postgresql-8.0 a very big query,
> select * from table where lala IN (....)
> Inside IN there are almost 60000 values.


> Unfortunately, the server terminates with a singal 11 and I get
> to my console the following:


It shouldn't crash. I suspect you tried this, got

ERROR: stack depth limit exceeded
HINT: Increase the configuration parameter "max_stack_depth".

and blindly followed the HINT without any regard for whether the value
you picked was actually safe on your platform. If you make
max_stack_depth bigger than what the kernel allows, you will indeed
get a crash; but that's not a bug it's pilot error.

More recent PG versions try to limit max_stack_depth to a safe value,
but 8.0 just believes what you tell it.

regards, tom lane

--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-16-2008, 01:00 AM
Tom Lane
 
Posts: n/a
Default Re: Problem with very big queries.

Panagiotis Papadakos <papadako@csd.uoc.gr> writes:
> I am using 8.0.15 postgres server and unfortunately can't upgrade to 8.3
> since I am using sp-gist tries.


How about 8.2?

> So, there is a limit in the allowable query length?


Not per se. Sufficiently complex queries will run out of memory,
of course. 8.2 and up handle long IN lists a bit more efficiently
than prior versions, so you can use longer lists in the same amount
of memory.

regards, tom lane

--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-16-2008, 01:00 AM
Panagiotis Papadakos
 
Posts: n/a
Default Re: Problem with very big queries.

On Friday 11 April 2008 02:22:30 Tom Lane wrote:
> Panagiotis Papadakos <papadako@csd.uoc.gr> writes:
> > I am using 8.0.15 postgres server and unfortunately can't upgrade to 8.3
> > since I am using sp-gist tries.

>
> How about 8.2?

Unfortunately not. I tried to compile even with 8.1 but many headers were
missing....
>
> > So, there is a limit in the allowable query length?

>
> Not per se. Sufficiently complex queries will run out of memory,
> of course. 8.2 and up handle long IN lists a bit more efficiently
> than prior versions, so you can use longer lists in the same amount
> of memory.
>
> regards, tom lane




--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-16-2008, 01:00 AM
Panagiotis Papadakos
 
Posts: n/a
Default Re: Problem with very big queries.

On Friday 11 April 2008 02:20:51 Tom Lane wrote:
> Panagiotis Papadakos <papadako@csd.uoc.gr> writes:
> > I want to send to postgresql-8.0 a very big query,
> > select * from table where lala IN (....)
> > Inside IN there are almost 60000 values.
> >
> > Unfortunately, the server terminates with a singal 11 and I get
> > to my console the following:

>
> It shouldn't crash. I suspect you tried this, got
>
> ERROR: stack depth limit exceeded
> HINT: Increase the configuration parameter "max_stack_depth".
>
> and blindly followed the HINT without any regard for whether the value
> you picked was actually safe on your platform. If you make
> max_stack_depth bigger than what the kernel allows, you will indeed
> get a crash; but that's not a bug it's pilot error.
>
> More recent PG versions try to limit max_stack_depth to a safe value,
> but 8.0 just believes what you tell it.

Yep you are correct. But I have set the value to 8192, based on ulimit -s but
it still crashes.
>
> regards, tom lane




--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-16-2008, 01:00 AM
Dave Cramer
 
Posts: n/a
Default Re: Problem with very big queries.

First you should upgrade your server to 8.0.15

The server is segfaulting. The driver is just reporting that the
server crashed.

Dave
On 10-Apr-08, at 6:52 PM, Panagiotis Papadakos wrote:

> Hello everybody.
>
> I want to send to postgresql-8.0 a very big query,
> select * from table where lala IN (....)
> Inside IN there are almost 60000 values.
>
> Unfortunately, the server terminates with a singal 11 and I get
> to my console the following:
>
> An I/O error occured while sending to the backend.
> An I/O error occured while sending to the backend.
>
> jdbc version is 8.0-322 JDBC 3.
>
> Could anybody help?
>
> Regards.
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc



--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-16-2008, 01:00 AM
John R Pierce
 
Posts: n/a
Default Re: Problem with very big queries.

Panagiotis Papadakos wrote:
> Hello everybody.
>
> I want to send to postgresql-8.0 a very big query,
> select * from table where lala IN (....)
> Inside IN there are almost 60000 values.
>



I think I'd put those 60000 values in their own table, and use some sort
of join.

select t.f1,t.f2 from table as t, table2 as b WHERE t.lala = b.lala;

or something like that. (i'm lousy at figuring out joins)



--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:43 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145