summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Misc.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-10-21 16:55:52 +0200
committerYorhel <git@yorhel.nl>2015-10-21 16:59:18 +0200
commitd5456b8ed5952b9fa061f0de536fab572c95016a (patch)
treebf70e1739ea47b0cd364fdf1fa60d4867795ff5a /lib/VNDB/Handler/Misc.pm
parent08a0d819efd244c8b3dacfd810b7322ad8df73fb (diff)
Improve SQL in dbRevisionGet()
Two main improvements: - Filtering on (non)hidden items now doesn't join any of the item tables, instead it looks up the latest revision from the changes table itself, using the index on (type,itemid,rev). It's still not super fast, but a pretty large improvement nonetheless. - The item titles/names are obtained in a separate query. I tried to modify the main query in various ways, but couldn't make it as fast as I'd have liked. I also removed the 'what' flag while I was at it, all uses of the method request all information anyway.
Diffstat (limited to 'lib/VNDB/Handler/Misc.pm')
-rw-r--r--lib/VNDB/Handler/Misc.pm3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm
index c32766b1..cb9a508a 100644
--- a/lib/VNDB/Handler/Misc.pm
+++ b/lib/VNDB/Handler/Misc.pm
@@ -70,7 +70,7 @@ sub homepage {
a href => '/hist', mt '_home_recentchanges'; txt ' ';
a href => '/feeds/changes.atom'; cssicon 'feed', mt '_atom_feed'; end;
end;
- my $changes = $self->dbRevisionGet(what => 'item user', results => 10, auto => 1);
+ my $changes = $self->dbRevisionGet(results => 10, auto => 1);
ul;
for (@$changes) {
li;
@@ -213,7 +213,6 @@ sub history {
# get the edit history
my($list, $np) = $self->dbRevisionGet(
- what => 'item user',
$type && $type ne 'u' ? ( type => $type, itemid => $id ) : (),
$type eq 'u' ? ( uid => $id ) : (),
$f->{t} ? ( type => $f->{t} eq 'a' ? [qw|v r p|] : $f->{t} ) : (),