[odb-users] Nested vector
Boris Kolpackov
boris at codesynthesis.com
Tue Nov 24 09:09:18 EST 2015
Hi,
Zeyang Tao <zeyangtao1020 at gmail.com> writes:
> Yes, I used odb::vector and only updated the elements which have been
> changed. It improved the performance a lot but we can still see the
> slowness issue accidentally.
>
> If I have pre knowledge about the matrix size, I think I can get rid of X
> and Y, do you think that will make a big difference?
I don't think so. I believe (though I can very well be wrong), the issue
is not the size of the data but the number of statements that has to be
executed.
> I am using postgresql.
Well, in this case, you can use PG array types. That is, map
std::vector<double> to DOUBLE PRECISION[], then use it as an element
of odb::vector<> (so each row will only be updated if some of its
elements have changed). For more information on how to map PG array
types, see "Extended Database to C++ Type Mapping in ODB":
http://www.codesynthesis.com/~boris/blog/2012/07/18/custom-database-to-cxx-type-mapping-in-odb/
Plus, the pgsql/custom test in the odb-tests package has a working
mapping for INTEGER[].
Also, would appreciate it if you let us whether this helps with your
performance issue.
Boris
More information about the odb-users
mailing list