aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/object-result.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-11-02 09:35:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-11-02 09:35:02 +0200
commitfb12544461cf4ea5fb331d726c96152c9389f995 (patch)
tree6c780a555d05db43a96c0da12b922603bedf3d3a /odb/sqlite/object-result.txx
parent8bff3a2fc0ccce05abef7972beefadcd2534bdcd (diff)
Optimize load_id(), load() sequence for SQLite and PostgreSQL
In these databases both of these functions load the data into the object image. If there is no chance of image overwrite between these calls, then we don't need to load the image the second time.
Diffstat (limited to 'odb/sqlite/object-result.txx')
-rw-r--r--odb/sqlite/object-result.txx5
1 files changed, 3 insertions, 2 deletions
diff --git a/odb/sqlite/object-result.txx b/odb/sqlite/object-result.txx
index dc258cc..f400fe4 100644
--- a/odb/sqlite/object-result.txx
+++ b/odb/sqlite/object-result.txx
@@ -35,9 +35,10 @@ namespace odb
template <typename T>
void object_result_impl<T>::
- load (object_type& obj)
+ load (object_type& obj, bool fetch)
{
- load_image ();
+ if (fetch)
+ load_image ();
// This is a top-level call so the statements cannot be locked.
//