[Bucardo-general] Performance option...
Michelle Sullivan
michelle at sorbs.net
Sun Aug 22 19:13:01 UTC 2010
Michelle Sullivan wrote:
> Poked! ;-)
> I haven't patched because I haven't spent enough time on it yet..
>
> However the current code for me at line 3992 reads:
>
> ## Note: column order important for splice and defined
> calls later
> $SQL{delta} = qq{
> SELECT DISTINCT $drow,
> BUCARDO_PK $aliaslist
> FROM bucardo.bucardo_delta d
> LEFT JOIN $S.$T t ON BUCARDO_JOIN
> WHERE d.tablename = \$1::oid
> AND NOT EXISTS (
> SELECT 1
> FROM bucardo.bucardo_track bt
> WHERE d.txntime = bt.txntime
> AND bt.targetdb = '\$2'::text
> AND bt.tablename = \$1::oid
> )
> };
>
Looking into the code over dinner (so not a proper look) I see the
following at line 4100:
## Mark all unclaimed visible delta rows as done in the
track table
## This must be called within the same transaction as the
delta select
## no critic (ProhibitInterpolationOfLiterals)
$SQL{track} = qq{
INSERT INTO bucardo.bucardo_track
(txntime,targetdb,tablename)
SELECT DISTINCT txntime, '\$1'::text, \$2::oid
FROM bucardo.bucardo_delta d
WHERE d.tablename = \$2::oid
AND NOT EXISTS (
SELECT 1
FROM bucardo.bucardo_track t
WHERE d.txntime = t.txntime
AND t.targetdb = '\$1'::text
AND t.tablename = \$2::oid
);
};
So I suspect this would have to be modified to accept the time of the
latest transaction sync'd which should in theory be a simple change.
Comments?
Shells
More information about the Bucardo-general
mailing list