On Friday, September 13, 2013 4:19:52 AM UTC-7, Noel Grandin wrote: > > > On 2013-09-13 13:12, Brian Craft wrote: > > I'm testing different insert scenarios. > > > > I was surprised to find that doing "insert into .. select * from .." > > from a large table is an order of magnitude slower than running > > individual "insert" commands for each row from a file. That is, if I > > load file -> table A with insert commands, then do "insert into B > > select * from A", the latter is 10x slower than the former. > > > That's very definitely off. Not sure what exactly, it's hard to say > without seeing the code. >
Could it be java -client vs -server? I'm running the "insert into ... select" interactively, and I see now that the process has -client. The file loader I'm starting w/o the -client flag, which I think defaults to -server. I'll try changing this. > > > Also, "create table B ... as select * from A" is impossibly fast. I'm > > guessing this is not touching the disk unless it's in a transaction, > > or something. > > > It definitely touches the disk, it just does a optimised data copy. > Hm... it's 4 minutes to load from file in a transaction, and 4 seconds to do "create table .. as select". The underlying data is 128M, so 32M/sec. I guess that works. The load from file, then, is cpu bound, apparently. The cpu is pegged at 100% most of the time. Profiling points to hotspots in h2 internals. Is this expected? -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out.
