From 42deb3c4599e745d9000b5684b408e02ddce987a Mon Sep 17 00:00:00 2001 From: Arne Georg Gleditsch Date: Wed, 12 Dec 2007 11:57:18 +0100 Subject: Sort ident searches the right way around, make sure local/member var results don't drown out more significant hits when limit kicks in. --- lib/LXRng/Index/DBI.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/LXRng/Index/DBI.pm') diff --git a/lib/LXRng/Index/DBI.pm b/lib/LXRng/Index/DBI.pm index f22ebab..667530d 100644 --- a/lib/LXRng/Index/DBI.pm +++ b/lib/LXRng/Index/DBI.pm @@ -278,14 +278,23 @@ sub _identifiers_by_name { my $pre = $self->prefix; my $sth = $$self{'sth'}{'_identifiers_by_name'} ||= $dbh->prepare(qq{ - select i.id, i.type, f.path, i.line, i.id_rfile + (select i.id, i.type, f.path, i.line, i.id_rfile from ${pre}identifiers i, ${pre}files f, ${pre}filereleases r, ${pre}revisions v where i.id_rfile = v.id and v.id = r.id_rfile and r.id_release = ? and v.id_file = f.id - and i.id_symbol = ? limit 500}); + and i.type != 'm' and i.type != 'l' + and i.id_symbol = ? limit 250) + union + (select i.id, i.type, f.path, i.line, i.id_rfile + from ${pre}identifiers i, ${pre}files f, + ${pre}filereleases r, ${pre}revisions v + where i.id_rfile = v.id and v.id = r.id_rfile + and r.id_release = ? and v.id_file = f.id + and (i.type = 'm' or i.type = 'l') + and i.id_symbol = ? limit 250)}); - $sth->execute($rel_id, $sym_id); + $sth->execute($rel_id, $sym_id, $rel_id, $sym_id); my $res = $sth->fetchall_arrayref(); return $res; -- cgit v1.2.3