Re: Why does slony use a cursor? Anyone know?

From: Filip Rembiałkowski <plk(dot)zuber(at)gmail(dot)com>
To: sthomas(at)optionshouse(dot)com
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why does slony use a cursor? Anyone know?
Date: 2013-03-07 13:40:23
Message-ID: CAP_rwwkVphfvvrp3nWshcq_d-_1F-jp33sesLb1ftQ40cYrokw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Mar 5, 2013 at 3:51 PM, Shaun Thomas <sthomas(at)optionshouse(dot)com>wrote:

> Hey everyone,
>
> Frankly, I'm shocked at what I just found.
>
> We did a delete last night of a few million rows, and come back this
> morning to find that slony is 9-hours behind. After some investigation, it
> became apparent that slony opens up a cursor and orders it by the
> log_actionseq column. Then it fetches 500 rows, and closes the cursor. So
> it's fetching several million rows into a cursor, to fetch 500, and then
> throw the rest away.
>
>

Why do you assume that opening a cursor with ORDER BY is equivalent to
fetching all rows? It is not.

Just curious what made you think so,

thanks

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shaun Thomas 2013-03-07 13:53:34 Re: Why does slony use a cursor? Anyone know?
Previous Message Neanderthelle Jones 2013-03-07 13:09:15 Gitorious