From dfbede13bdc76b43f8a4463bd8e912306f440b4d Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Wed, 28 Jan 2009 20:31:11 +0100 Subject: [PATCH] No need to have index on target modfication date --- lib/NDWeb/Controller/JSRPC.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/NDWeb/Controller/JSRPC.pm b/lib/NDWeb/Controller/JSRPC.pm index 3bea69a..aade3c7 100644 --- a/lib/NDWeb/Controller/JSRPC.pm +++ b/lib/NDWeb/Controller/JSRPC.pm @@ -38,7 +38,8 @@ sub update : Local { my $targets;; if ($from){ - my ($timestamp) = $dbh->selectrow_array("SELECT MAX(modified)::timestamp AS modified FROM raid_targets"); + my ($timestamp) = $dbh->selectrow_array(q{SELECT MAX(modified)::timestamp AS modified + FROM raid_targets WHERE raid = $1},undef,$raid->{id}); $c->stash(timestamp => $timestamp); $targets = $dbh->prepare(q{SELECT r.id,r.planet FROM raid_targets r WHERE r.raid = ? AND modified > ? -- 2.39.2