Christopher Browne cbbrowne at ca.afilias.info
Tue Nov 18 16:21:08 PST 2008
Kenny Gorman <kgorman at hi5.com> writes:
> We have this same request.  Essentially in our case we may or may not
> have anything reading the slave right away.  So simply providing an
> option of skipping the analyze would be nice.  This way we can have a
> separate process analyze as we feel appropriate (or auto).

The ANALYZE is a complete red herring, here; if you've got a many-hour
subscription, it's not ANALYZE that is costly, it's the REINDEX.

> Of course it would be very nice to be able to specify a level of
> parallelism for the COPY processes to run in as well. In many cases
> there is no benefit to running everything in serial.  By randomizing
> the tables being COPY'd, you stand a reasonable chance of all
> processes having about the same amount of work to do and the fastest
> completion time.  Of course you could employ a more elaborate
> algorithm based on size and get better balancing.

We have frequently seen cases where the REINDEX takes longer, for
large tables, than the COPY, and I suspect that's frequently the case,
which implies that the "big win" comes from parallelizing index
regens.

I *love* seeing heuristics where random selection is the "winning
strategy," but I don't believe that this is the case here.  We can be
reasonably certain that the large tables are the ones that will take
longer to REINDEX, and that they are the ones that should be "queued
up" first.

This part of the patch is not elaborate; it changes just one line of
code:

RCS file: /home/cvsd/slony1/slony1-engine/src/slon/remote_worker.c,v
retrieving revision 1.176
diff -c -u -r1.176 remote_worker.c
cvs diff: conflicting specifications of output style
--- src/slon/remote_worker.c	29 Aug 2008 21:06:45 -0000	1.176
+++ src/slon/remote_worker.c	19 Nov 2008 00:19:55 -0000
@@ -2635,7 +2635,7 @@
 						"where T.tab_set = %d "
 						"    and T.tab_reloid = PGC.oid "
 						"    and PGC.relnamespace = PGN.oid "
-						"order by tab_id; ",
+						"order by PGC.relpages desc; ",
 						rtcfg_namespace,
 						rtcfg_namespace,
 						rtcfg_namespace,
-- 
(format nil "~S@~S" "cbbrowne" "linuxfinances.info")
http://www3.sympatico.ca/cbbrowne/rdbms.html
As of next Tuesday, ITS will be flushed in favor of TRSDOS 2.1.
Please kill yourself.


More information about the Slony1-general mailing list