> From: Shaun Thomas <sthomas@optionshouse.com
> To: PostgreSQL General <pgsql-general@postgresql.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
likebug 167 which was fixed in 2.1.2 if I remember correctly.
Glyn