[odb-users] Explain please the essence of the strange update_statement

Вячеслав Спиридонов art at it-gen.net
Fri Sep 9 08:32:39 EDT 2011


Dear, Boris and odb-users

Explain please the essence of the strange update_statement.

PRAGMA_DB(object table("players"))
class CDboPlayer
{
public:
PRAGMA_DB(id)
  int    Id;
PRAGMA_DB(type("TIMESTAMP"))
  ptime     LastAuth;
  string    Name;

private:
  friend class odb::access;
};

const char* const access::object_traits< ::CDboPlayer >::update_statement =
"UPDATE `players` SET "
"`Id` = ?,"
"`LastAuth` = ?,"
"`Name` = ?"
" WHERE `Id` = ?";

What is the point in UPDATE to overwrite PRIMARY KEY? It seems to me
that this could a negatively affect to the group UPDATE. Now I am
faced with a situation when the update 50K of objects CDboPlayer work
out very slowly (about a few minutes.) The operation was carried out a
single-stream, any locks are excluded.

Best regards,
Viacheslav and SBA



More information about the odb-users mailing list