diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2014-05-08 10:40:02 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2014-05-08 10:40:02 -0400 |
commit | c1f8b1e82b4c690734d7f2fed604f9cf1e93c445 (patch) | |
tree | fda4f7b859a6fc2f902976064f0c5f132be80b23 /GradeBook_lib.tcl | |
parent | 23dab0dc09e5efbccdbe1077578eecd9e41fd70f (diff) | |
download | GradeBook-c1f8b1e82b4c690734d7f2fed604f9cf1e93c445.tar.gz GradeBook-c1f8b1e82b4c690734d7f2fed604f9cf1e93c445.zip |
added begin/end transactions during stat updates: significant speedup
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-x | GradeBook_lib.tcl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index e53e78f..dd38bd4 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -2095,6 +2095,7 @@ proc UpdateColumnStDevGrade { columnname } { proc UpdateGradesTableStatistic { permission_list user } { + begin_db_transaction set grades_categories [get_grades_category] # remove unset and deleted categories from stats calculation @@ -2122,11 +2123,14 @@ proc UpdateGradesTableStatistic { permission_list user } { set update_parent_flag false UpdateColumnStatistic $columnname $update_parent_flag } + end_db_transaction } proc UpdateColumnStatistic { columnname {update_parent_flag true} } { + begin_db_transaction set all_column_names [getColListFromTable GradesTable] if { $columnname ni $all_column_names } { + end_db_transaction return } UpdateColumnHighestGrade $columnname @@ -2147,6 +2151,7 @@ proc UpdateColumnStatistic { columnname {update_parent_flag true} } { set root_category_column "Grand Total" } UpdateColumnStatistic $root_category_column + end_db_transaction } proc UpdateGrades { permission_list user } { |