Commit 1ba82c91 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Speed up query that was taking 1 second, now down to 0.01.

parent ff99b93b
/* /*
* EMULAB-COPYRIGHT * EMULAB-COPYRIGHT
* Copyright (c) 2000-2002 University of Utah and the Flux Group. * Copyright (c) 2000-2003 University of Utah and the Flux Group.
* All rights reserved. * All rights reserved.
*/ */
...@@ -205,11 +205,11 @@ main(int argc, char **argv) ...@@ -205,11 +205,11 @@ main(int argc, char **argv)
* Figure out current owner. Might not be a reserved node, * Figure out current owner. Might not be a reserved node,
* in which case set it to root/wheel by default. * in which case set it to root/wheel by default.
*/ */
res = mydb_query("select g.unix_gid from groups as g " res = mydb_query("select g.unix_gid from reserved as r "
"left join experiments as e " "left join experiments as e on "
" on g.pid=e.pid and g.gid=e.gid " " r.pid=e.pid and r.eid=e.eid "
"left join reserved as r " "left join groups as g on "
" on e.pid=r.pid and e.eid=r.eid " " g.pid=e.pid and g.gid=e.gid "
"where r.node_id='%s'", "where r.node_id='%s'",
1, node_id); 1, node_id);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment