Generic query result bulk loading operations
Issue #30
new
Originally reported on Google Code with ID 30
Right now there's SQLiteStatement.loadLongs() which is a fast way to transfer one column
of integer values from SQLite into Java. A generic method to transfer any type of data
and in multiple columns is needed.
Reported by sereda
on 2011-06-29 12:36:01
Comments (9)
-
Account Deleted -
Account Deleted I think it is perfectly reasonable to postpone this optimization. Best. Le 22 sept. 2014 12:15, <sqlite4java@googlecode.com> a écrit :
Reported by
dbouyssie
on 2014-09-24 20:31:36 -
Account Deleted I am also interested in this feature. The question might sound stupid after the responses, but would be also many effort to make a version for other data types? For example, SQLiteStatement.loadDouble() or SQLiteStatement.loadString(). I think that covering most of the data types would be interesting. I am specifically interested in the double one, since I am creating a database with data collected from wearable devices. Regards, Alejandro.
Reported by
alejandrosaez3
on 2014-11-11 17:08:30 -
reporter Alejandro, do you need to just load multiple double values or do you need a speed-optimized method? In the former case, you can just iterate through statement results and retrieve the values with columnDouble(). If you need an optimized method, let me ask you, what platform does your code run on? What JVM version do you have there? Igor
Reported by
sereda
on 2014-11-11 19:29:56 -
Account Deleted Currently I am interating through statement results and retrieving the values with columnDouble(). I did a quick benchmark selecting 5 millions of rows and got a great improvement with the SQLiteStatement.loadInt() (in some cases even 50% faster!). Probably wasn´t the most reliable benchmark ever, but it was enough for me.The database will have eventually 50 millions of rows or even more so that I am interesting in a speed-optimized method (any idea is welcome!). I am running the application on Windows but in the future will run on OSX and maybe on Linux. I am using the JVM 7. Regards, Alejandro.
Reported by
alejandrosaez3
on 2014-11-11 23:29:15 -
Account Deleted I forgor to say that you did a great job with the wrapper. As a developer, I know how good is when people recognise your work. Alejandro
Reported by
alejandrosaez3
on 2014-11-11 23:35:14 -
reporter Alejandro, thanks for your kind words :) At the time when loadLongs() method was introduced, the performance improvement was around 10x faster, so it was a big deal. We did benchmarks with the modern JVMs - the results are mentioned above, only 20% improvement, maybe even 50% improvement as you mentioned. In our opinion, this is not that bad. We may still work on providing a generic method for bulk loading results, but given the complexity involved (and we're not going to just add loadDoubles() method, but rather load multiple columns of different types into a buffer), we won't be able to work on it in the near future. So the issue remains open, but low priority. Sorry about that! If you very much need loadDoubles() method, you can try adding it yourself, basically making a copy of the call chain under loadLongs() method. Please let us know if you succeed. Kind regards, Igor
Reported by
sereda
on 2014-11-12 07:29:15 -
Account Deleted I totally understand it. No worries! I don't think I will try it now, but if I will let you know if I try it in the future. Thank you for your response. Regards, Alejandro.
Reported by
alejandrosaez3
on 2014-11-13 08:52:00 -
reporter 4 votes
- Log in to comment
Reported by
sereda@almworks.com
on 2014-09-22 10:15:09 - Labels added: Priority-Low - Labels removed: Priority-Medium