user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: Re: [WIP] extindex: support --dedupe[=MSGID]
Date: Sat, 24 Jul 2021 06:34:30 +0000	[thread overview]
Message-ID: <20210724063430.GA12660@dcvr> (raw)
In-Reply-To: <20210722085034.31363-1-e@80x24.org>

Eric Wong <e@80x24.org> wrote:
> Anyways, before this patch, "-extindex --dedupe" was taking ~5
> min to no-op every message (after the initial full --dedupe run
> which took over a day to run).  Now that it appears to be doing
> many more dedupes, so it could take 40-ish hours to finish the
> dedupe run on the machine running <https://yhbt.net/lore/all/>.

Nearly 44 hours (on a busy system), but that was only because of
a bug which caused half the work to get skipped (fix below).

Xapian glass (1.4.x) really falls down with large shards and
making -xcpdb work with extindex to reshard into more shards
will be required to maintain performance as an extindex grows...

diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm
index 442ded46..2311161e 100644
--- a/lib/PublicInbox/ExtSearchIdx.pm
+++ b/lib/PublicInbox/ExtSearchIdx.pm
@@ -895,12 +895,13 @@ sub eidx_dedupe ($$$) {
 	return unless eidxq_lock_acquire($self);
 	my ($iter, $cur_mid);
 	my $min_id = 0;
+	my $idx = 0;
 	local $sync->{-regen_fmt} = "dedupe %u/".$self->{oidx}->max."\n";
 
 	# note: we could write this query more intelligently,
 	# but that causes lock contention with read-only processes
 dedupe_restart:
-	$cur_mid = shift @$msgids;
+	$cur_mid = $msgids->[$idx];
 	if ($cur_mid eq '') { # all Message-IDs
 		$iter = $self->{oidx}->dbh->prepare(<<EOS);
 SELECT mid,id FROM msgid WHERE id > ? ORDER BY id ASC
@@ -945,7 +946,7 @@ EOS
 			goto dedupe_restart;
 		}
 	}
-	goto dedupe_restart if scalar(@$msgids);
+	goto dedupe_restart if defined($msgids->[++$idx]);
 
 	my $n = delete $sync->{dedupe_cull};
 	if (my $pr = $sync->{-opt}->{-progress}) {

  reply	other threads:[~2021-07-24  6:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22  8:50 [WIP] extindex: support --dedupe[=MSGID] Eric Wong
2021-07-24  6:34 ` Eric Wong [this message]
2021-07-25  0:11   ` [PATCH 0/3] extindex dedupe improvements Eric Wong
2021-07-25  0:11     ` [PATCH 1/3] extindex: support --dedupe[=MSGID] Eric Wong
2021-07-25  0:11     ` [PATCH 2/3] extindex: improve comment around git->async_wait_all Eric Wong
2021-07-25  0:11     ` [PATCH 3/3] extsearchidx: use more appropriate max for dedupe Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210724063430.GA12660@dcvr \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).