Hi, I think in this case, HSQLDB keeps the index on disk.
I ran the test on my machine and it looks like there is a problem in H2 here when using the PageStore (which is the default for the version of H2 you are using). With a recent version of H2 (with the MVStore), it is much better, even thought initially inserts are slower. This I will still need to work on. As for indexing randomly distributed data, a fast way is to do it chunk by chunk, where a chunk fits in memory. Basically, sort the chunk, store it, then process the next chunk, and so on. Once you are done, sort the chunks using merge sort. This is what I did in the ArchiveTool: https://github.com/h2database/h2database/blob/master/h2/src/tools/org/h2/dev/fs/ArchiveTool.java - there is also a version that use the MVStore: https://github.com/h2database/h2database/blob/master/h2/src/tools/org/h2/dev/fs/ArchiveToolStore.java With revent versions of H2, with the MVStore, this algorithm is used if you create an index after inserting the data. So if you move "create index" after inserting, then inserting is much faster. Creating the index is also fast. Regards, Thomas On Fri, May 22, 2015 at 1:55 PM, Noel Grandin <[email protected]> wrote: > I don't think hsqldb supports on-disk indexes, it's indexes are always > stored only in RAM, so it has less disk IO to perform. (but I could be > wrong, corrections welcome). > > At the moment, H2 does not support memory-only indexes on disk-based data > (but patches are welcome) > > > -- > 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/d/optout. > -- 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/d/optout.
