So, after trying out the TABLE function, I got an average of about 50% improvement in my query execution time. For about 50 IDs, it takes around 10ms or less. Naturally, part of the improvement is the fact that I do not need to construct a dynamic query by concatenating Strings.
One small note: it would be even more efficient for me to pass a collections of integers to the prepared statement, rather than an array. I use collections throughout my code and there's a small execution and memory overhead in converting the collection to an array. Thanks for the help, Zviki On Feb 18, 10:03 pm, Thomas Mueller <[email protected]> wrote: > Hi, > > > So, the integer array passed as a prepared statement parameter will > > become a temporary memory table which will be crossed with my existing > > table? > > Yes, exactly. That's how the IN(...) optimization works by the way > (version >= 1.1.x; you can check that using EXPLAIN SELECT ...). > > Regards, > Thomas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/h2-database?hl=en -~----------~----~----~----~------~----~------~--~---
