Commit f9794978 authored by Robert Ricci's avatar Robert Ricci

Speed up the load_address query in tmcd somewhat

parent 6fc341a8
......@@ -315,7 +315,8 @@ CREATE TABLE images (
ezid tinyint(4) NOT NULL default '0',
shared tinyint(4) NOT NULL default '0',
updated datetime default NULL,
PRIMARY KEY (imagename,pid)
PRIMARY KEY (imagename,pid),
KEY imageid (imageid)
) TYPE=MyISAM;
--
......@@ -492,7 +493,7 @@ CREATE TABLE node_idlestats (
) TYPE=MyISAM;
--
-- Table structure for table 'node_types'
-- Table structure for table 'node_status'
--
CREATE TABLE node_status (
......
......@@ -2682,8 +2682,8 @@ COMMAND_PROTOTYPE(doloadinfo)
/*
* Get the address the node should contact to load its image
*/
res = mydb_query("select load_address,loadpart,OS from images as i "
"left join current_reloads as r on i.imageid = r.image_id "
res = mydb_query("select load_address,loadpart,OS from current_reloads as r "
"left join images as i on i.imageid = r.image_id "
"left join os_info as o on i.default_osid = o.osid "
"where node_id='%s'",
3, reqp->nodeid);
......
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