Eliminate a constraint from the query in the interest of efficiency. The

alternative is to add another index on (name, server_state) to the
result table.

svn path=/trunk/boinc/; revision=5487
This commit is contained in:
Bruce Allen 2005-02-21 22:32:38 +00:00
parent 9b23331b4a
commit bca7853358
1 changed files with 10 additions and 0 deletions

View File

@ -604,10 +604,20 @@ static int send_new_file_work_deterministic_seeded(
if (end_f && strcmp(min_resultname, end_f)>=0)
break;
#if 0
// an alternative here is to add ANOTHER index on name, server_state
// to the result table.
sprintf(query,
"where server_state=%d and name>'%s' order by name limit 1",
RESULT_SERVER_STATE_UNSENT, min_resultname
);
#endif
sprintf(query,
"where name>'%s' order by name limit 1",
min_resultname
);
retval = result.lookup(query);
if (retval) break; // no more unsent results or at the end of the filenames, return -1
retval = extract_filename(result.name, filename);