From 6fffce897808e2f7504fca6bc48de54d0a619b5e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 22 Jul 2004 15:32:30 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=3936 --- checkin_notes | 11 ++++++++++- db/boinc_db.C | 10 ++++++++++ db/boinc_db.h | 1 + sched/sched_send.C | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index 41d0cd2165..e62e427d03 100755 --- a/checkin_notes +++ b/checkin_notes @@ -15597,4 +15597,13 @@ Noaa 21 July 2004 api/ gutil.h - Makefile.graphics \ No newline at end of file + Makefile.graphics + +David 22 July 2004 + - Another DB performance tweak: add DB_RESULT::update_subset() + to update just those fields needed when send a result + + db/ + boinc_db.C,h + sched/ + sched_send.C diff --git a/db/boinc_db.C b/db/boinc_db.C index 127495c9cf..92582a603f 100644 --- a/db/boinc_db.C +++ b/db/boinc_db.C @@ -520,6 +520,16 @@ void DB_RESULT::db_print_values(char* buf){ UNESCAPE(stderr_out); } +int DB_RESULT::update_subset() { + char query[MAX_QUERY_LEN]; + + sprintf(query, + "update %s set server_state=%d, hostid=%d, userid=%d, sent_time=%d, report_deadline=%d", + server_state, hostid, userid, sent_time, report_deadline + ); + return db->do_query(query); +} + void DB_RESULT::db_parse(MYSQL_ROW &r) { int i=0; clear(); diff --git a/db/boinc_db.h b/db/boinc_db.h index b91a350efa..b77c878fc1 100755 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -534,6 +534,7 @@ class DB_RESULT : public DB_BASE, public RESULT { public: DB_RESULT(); int get_id(); + int update_subset(); void db_print(char*); void db_print_values(char*); void db_parse(MYSQL_ROW &row); diff --git a/sched/sched_send.C b/sched/sched_send.C index 98c743325d..eba40047da 100644 --- a/sched/sched_send.C +++ b/sched/sched_send.C @@ -642,7 +642,7 @@ static void scan_work_array( result.userid = reply.user.id; result.sent_time = time(0); result.report_deadline = result.sent_time + wu.delay_bound; - result.update(); + result.update_subset(); wu_seconds_filled = estimate_cpu_duration(wu, reply.host); log_messages.printf(