aboutsummaryrefslogtreecommitdiff
path: root/odb/pgsql/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
commit4cca29a2d9085a495a198b252a4c0d18b3ff9c76 (patch)
tree579461dec3c8a787e46e8727a18d5814927670f9 /odb/pgsql/object-result.txx
parentb820128512133c443799b27265e28a27622497e6 (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/pgsql/object-result.txx')
-rw-r--r--odb/pgsql/object-result.txx5
1 files changed, 3 insertions, 2 deletions
diff --git a/odb/pgsql/object-result.txx b/odb/pgsql/object-result.txx
index 57a70d7..6459906 100644
--- a/odb/pgsql/object-result.txx
+++ b/odb/pgsql/object-result.txx
@@ -34,9 +34,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.
//