pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: AgentM <agentm@themactionfaction.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: "stack depth limit exceeded" executing DELETE FROM
Date: Tue, 5 Sep 2006 15:18:46 -0400
Message-ID: <8F44EB66-D8CE-4228-8AE7-C5500F6B5766@themactionfaction.com> (raw)
In-Reply-To: <20060905184450.GA41016@winnie.fuhr.org>
References: <3240464A2687334E92AAB86DAB6504530132D21B@USILMS13.ca.com>
	<20060905184450.GA41016@winnie.fuhr.org>


On Sep 5, 2006, at 14:44 , Michael Fuhr wrote:

> On Tue, Sep 05, 2006 at 02:18:05PM -0400, Cox, Brian wrote:
>> The following fails with a "stack depth limit exceeded":
>>
>> DELETE FROM some-table WHERE pk IN (pk1, pk2, ..., pkN)
>>
>> where pk = primary key and N is large, may be > 50000.
>>
>> Is there some limit as to the number of rows that can
>> be deleted in a single DELETE?
>
> The error isn't due to the number of rows being deleted but rather
> from parsing the large number of items in the IN list.  See the
> following thread:
>
> http://archives.postgresql.org/pgsql-general/2006-01/msg00959.php

You have been receiving great advice from the other guys, but another  
thing to try is to use some middleware to determine which ranges your  
delete set covers and use WHERE pk BETWEEN x AND y, potentially  
improving index usage performance.

-M



view thread (5+ messages)

Message-ID: <8F44EB66-D8CE-4228-8AE7-C5500F6B5766@themactionfaction.com>
Permalink:  ../8F44EB66-D8CE-4228-8AE7-C5500F6B5766@themactionfaction.com/
Also on:    postgresql.org/message-id/8F44EB66-D8CE-4228-8AE7-C5500F6B5766@themactionfaction.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: agentm@themactionfaction.com
  Subject: Re: "stack depth limit exceeded" executing DELETE FROM
  In-Reply-To: <8F44EB66-D8CE-4228-8AE7-C5500F6B5766@themactionfaction.com>
  References: <3240464A2687334E92AAB86DAB6504530132D21B@USILMS13.ca.com> <20060905184450.GA41016@winnie.fuhr.org> <8F44EB66-D8CE-4228-8AE7-C5500F6B5766@themactionfaction.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