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

From: Glyn Astill <glynastill(at)yahoo(dot)co(dot)uk>
To: "sthomas(at)optionshouse(dot)com" <sthomas(at)optionshouse(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why does slony use a cursor? Anyone know?
Date: 2013-03-06 10:49:29
Message-ID: 1362566969.22078.YahooMailNeo@web133205.mail.ir2.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> From: Shaun Thomas <sthomas(at)optionshouse(dot)com
> To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
> Cc:
> Sent: Tuesday, 5 March 2013, 14:51
> Subject: [GENERAL] Why does slony use a cursor? Anyone know?
>
> 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.
>
> That is quite possibly the least efficient manner I could think of to build a
> sync system, so maybe someone knows why they did it that way?
>
> At least with a regular query, it could sort by the column it wanted, and put a
> nifty index on it for those 500-row chunks it's grabbing. I must be missing
> something...

What version of slony are you on?  The specifics of what you mention don't sound quite right, but it sounds very much like bug 167 which was fixed in 2.1.2 if I remember correctly.

Glyn

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Farber 2013-03-06 12:30:44 Change owner for all tables in a database in one batch
Previous Message Christian Ullrich 2013-03-06 10:16:58 Re: PostgreSQL connect with Visual C++