This speeds up xt/imapd-validate.t by around 10% when used with
an abandoned patch to remove ->query_xover. We may also depend
on this further if we abandon storing doc_data in Xapian to save
disk space.
sub get_art {
my ($self, $num) = @_;
my $dbh = $self->connect;
- my $smsg = $dbh->selectrow_hashref(<<'', undef, $num);
+ my $sth = $dbh->prepare_cached(<<'', undef, 1);
SELECT num,ds,ts,ddd FROM over WHERE num = ? LIMIT 1
- return load_from_row($smsg) if $smsg;
- undef;
+ $sth->execute($num);
+ my $smsg = $sth->fetchrow_hashref;
+ $smsg ? load_from_row($smsg) : undef;
}
sub next_by_mid {