Orphaned results in database


Advanced search

Message boards : Number crunching : Orphaned results in database

Sort
Author Message
Ananas

Joined: Aug 29 09
Posts: 56
ID: 17736
Credit: 2,500,425
RAC: 0
Message 6892 - Posted 10 Oct 2012 7:19:19 UTC

You have the same problem that we have seen in RNA-World not long ago, some old results are still in the database that have no workunit record anymore.

Example :

resultid=27497235

Ananas

Joined: Aug 29 09
Posts: 56
ID: 17736
Credit: 2,500,425
RAC: 0
Message 6986 - Posted 7 Nov 2012 4:56:35 UTC
Last modified: 7 Nov 2012 5:08:23 UTC

*bump*

You should do a cleanup run, something like

"delete from result where result.workunitid not in (select distinct workunit.id from workunit)"

or

"delete from result where not exists (select distinct workunit.id from workunit where workunit.id = result.workunitid"

Message boards : Number crunching : Orphaned results in database

Database Error
: The MySQL server is running with the --read-only option so it cannot execute this statement
array(3) {
  [0]=>
  array(7) {
    ["file"]=>
    string(47) "/boinc/projects/docking/html_v2/inc/db_conn.inc"
    ["line"]=>
    int(97)
    ["function"]=>
    string(8) "do_query"
    ["class"]=>
    string(6) "DbConn"
    ["object"]=>
    object(DbConn)#7 (2) {
      ["db_conn"]=>
      resource(54) of type (mysql link persistent)
      ["db_name"]=>
      string(7) "docking"
    }
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(1) {
      [0]=>
      &string(51) "update DBNAME.thread set views=views+1 where id=694"
    }
  }
  [1]=>
  array(7) {
    ["file"]=>
    string(48) "/boinc/projects/docking/html_v2/inc/forum_db.inc"
    ["line"]=>
    int(60)
    ["function"]=>
    string(6) "update"
    ["class"]=>
    string(6) "DbConn"
    ["object"]=>
    object(DbConn)#7 (2) {
      ["db_conn"]=>
      resource(54) of type (mysql link persistent)
      ["db_name"]=>
      string(7) "docking"
    }
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(3) {
      [0]=>
      object(BoincThread)#3 (16) {
        ["id"]=>
        string(3) "694"
        ["forum"]=>
        string(1) "2"
        ["owner"]=>
        string(5) "17736"
        ["status"]=>
        string(1) "0"
        ["title"]=>
        string(28) "Orphaned results in database"
        ["timestamp"]=>
        string(10) "1352264195"
        ["views"]=>
        string(2) "73"
        ["replies"]=>
        string(1) "1"
        ["activity"]=>
        string(19) "5.3495978837642e-35"
        ["sufferers"]=>
        string(1) "0"
        ["score"]=>
        string(1) "0"
        ["votes"]=>
        string(1) "0"
        ["create_time"]=>
        string(10) "1349853559"
        ["hidden"]=>
        string(1) "0"
        ["sticky"]=>
        string(1) "0"
        ["locked"]=>
        string(1) "0"
      }
      [1]=>
      &string(6) "thread"
      [2]=>
      &string(13) "views=views+1"
    }
  }
  [2]=>
  array(7) {
    ["file"]=>
    string(63) "/boinc/projects/docking/html_v2/user/community/forum/thread.php"
    ["line"]=>
    int(184)
    ["function"]=>
    string(6) "update"
    ["class"]=>
    string(11) "BoincThread"
    ["object"]=>
    object(BoincThread)#3 (16) {
      ["id"]=>
      string(3) "694"
      ["forum"]=>
      string(1) "2"
      ["owner"]=>
      string(5) "17736"
      ["status"]=>
      string(1) "0"
      ["title"]=>
      string(28) "Orphaned results in database"
      ["timestamp"]=>
      string(10) "1352264195"
      ["views"]=>
      string(2) "73"
      ["replies"]=>
      string(1) "1"
      ["activity"]=>
      string(19) "5.3495978837642e-35"
      ["sufferers"]=>
      string(1) "0"
      ["score"]=>
      string(1) "0"
      ["votes"]=>
      string(1) "0"
      ["create_time"]=>
      string(10) "1349853559"
      ["hidden"]=>
      string(1) "0"
      ["sticky"]=>
      string(1) "0"
      ["locked"]=>
      string(1) "0"
    }
    ["type"]=>
    string(2) "->"
    ["args"]=>
    array(1) {
      [0]=>
      &string(13) "views=views+1"
    }
  }
}
query: update docking.thread set views=views+1 where id=694