From: | Shaun Thomas <sthomas(at)optionshouse(dot)com> |
---|---|
To: | PostgreSQL General <pgsql-general(at)postgresql(dot)org> |
Subject: | Why does slony use a cursor? Anyone know? |
Date: | 2013-03-05 14:51:11 |
Message-ID: | 5136065F.9060401@optionshouse.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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...
Yeah, I know... millions of rows + slony = bad. But it doesn't have to
be *this* bad. Even a few hundred thousand rows would be terrible with
this design.
I plan on asking the slony guys too, but I figured someone on this list
might happen to know.
Looks like I might have to look into Bucardo or Londiste.
Thanks!
--
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604
312-676-8870
sthomas(at)optionshouse(dot)com
______________________________________________
See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2013-03-05 14:52:34 | Re: 9.2 timestamp function syntax error |
Previous Message | Heikki Linnakangas | 2013-03-05 14:32:41 | Re: [GENERAL] Floating point error |