Hi,

> in-memory mode (where all the tables are kept in memory right?),

Yes.

> can I specify how much memory to allow H2 to use?

No. Calculating the exact amount of memory used would slow things down a lot.

>  Like if H2
> ran out of main memory to keep all the tables in, would it then do
> some kind of hybrid approach where some tables were kept in main
> memory and the rest were kept on disk?

I suggest to just use the regular persistent mode (jdbc:h2:~/test). H2
automatically uses a cache so performance is quite good. If you have
more (or very little) memory just set the cache size - see
http://www.h2database.com/html/grammar.html#setcachesize

> how much improvement on the simple operations
> (insert, request) could be made using in-memory tables?

I don't know, maybe 5-10 times faster. But it depends on the use case,
you need to test it yourself.

> is it pretty simple to change the configuration to make the
> database use disk-based tables instead of in-memory ones?

If the tables don't need to be persisted, just change the database
URL. See http://www.h2database.com/html/features.html#memory_only_databases

If they need to be persisted, use SET DEFAULT_TABLE_TYPE MEMORY, see also
http://www.h2database.com/html/grammar.html#setdefaulttabletype
You can append that to the database URL:
jdbc:h2:~/test;DEFAULT_TABLE_TYPE=MEMORY

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to