diff options
author | Eric Wong <e@80x24.org> | 2020-11-27 09:52:54 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-11-28 04:53:23 +0000 |
commit | 811b8d3cbaa790f59b7b107140b86248da16499b (patch) | |
tree | c380c0baf53114b71e1b5c440e41d58ab7fa78fb /t/nntp.t | |
parent | b8ff2f71f04c8a2b959d6142bc7e770672589e8a (diff) | |
download | public-inbox-811b8d3cbaa790f59b7b107140b86248da16499b.tar.gz |
nntp: xref: use ->ALL extindex if available
Getting Xref for cross-posted messages is an O(n) operation where `n' is the number of newsgroups on the server. This works acceptably when there are dozens of groups, but would be unnacceptable when there's tens of thousands of newsgroups. With ~140 newsgroups, a lore.kernel.org mirror already handles "XHDR Xref $MESSAGE_ID" requests around 30% faster after creating the xref3.idx_nntp index. The SQL additions to ExtSearch.pm may be a bit strange and seem more appropriate for Over.pm; however it currently makes sense to me since those bits of over.sqlite3 access are exclusive to ExtSearch and can't be used by traditional v1/v2 inboxes...
Diffstat (limited to 't/nntp.t')
-rw-r--r-- | t/nntp.t | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -8,6 +8,7 @@ use PublicInbox::Eml; require_mods(qw(DBD::SQLite Data::Dumper)); use_ok 'PublicInbox::NNTP'; use_ok 'PublicInbox::Inbox'; +use PublicInbox::Config; { sub quote_str { @@ -110,7 +111,11 @@ use_ok 'PublicInbox::Inbox'; my $mime = PublicInbox::Eml->new("Message-ID: <$mid>\r\n\r\n"); my $hdr = $mime->header_obj; my $mock_self = { - nntpd => { grouplist => [], servername => 'example.com' }, + nntpd => { + grouplist => [], + servername => 'example.com', + pi_config => bless {}, 'PublicInbox::Config', + }, ng => $ng, }; my $smsg = { num => 1, mid => $mid, nntp => $mock_self, -ibx => $ng }; |