Re: Receiving many more rows than expected

From: Vincent de Phily <vincent(dot)dephily(at)mobile-devices(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Cc: Sim Zacks <sim(at)compulab(dot)co(dot)il>
Subject: Re: Receiving many more rows than expected
Date: 2014-05-09 08:07:56
Message-ID: 2249840.yCLJeqVYQJ@moltowork
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 08 May 2014 16:05:59 Sim Zacks wrote:
> On 05/08/2014 02:09 PM, Vincent de Phily wrote:
> The problem is that sometimes (once every few days at about 2-300K queries
> per day) I get many more rows than the max 5000 I asked for (I've seen up
> to 25k). And I'm getting timeouts and other problems as a result.
> I would bet you have another copy of the code running without the limit.
> Maybe on a cron job. To prove this, modify the log statement slightly and
> see if this statement is really returning more then 5000 rows. LOG.debug("1
> - Fetched %d rows", rlen) or similar.

I assure you I don't :/ The program is only 350 lines including plenty of good
comments, it'd be hard to miss a rogue query.

Exhaustive list of queries:
- pg_try_advisory_lock to make sure that only one instance is running at a
time
- set processing='f' during startup
- delete from foo where id in (fully_processed_records)
- listen for the notification from an "on insert" trigger on table foo
- select highest and lowest record in foo for monitoring purpose

--
Vincent de Phily

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2014-05-09 08:25:35 Re: Oracle to PostgreSQL replication
Previous Message Rajni Baliyan 2014-05-09 07:46:32 Re: Oracle to PostgreSQL replication