tags:

views:

53

answers:

4

I have 10 tables from which 4 contain each up to million rows. All values are inserted at once, and afterwards I only read the data many times. I am searching for a database that would perform greatly when it comes to selecting, joining or other reading etc.

What is the most recommended option?

+2  A: 

if you add proper indexes it will not matter much. Database design here might be more important.

Andrey
A: 

I would answer simply "SQLite", but that alone is too short, according to Stackoverflow. So I padded it out with this additional text.

Larry Lustig
A: 

I think you're going to have to give some more detail to get a good answer. What sort of performance are you looking for, and on what hardware/OS? What kind of queries are you going to be doing?

A million rows really isn't all that many for a decent database server. If you want to best possible retrieval performance, you'll want to use an in-memory table, if you have enough memory for it all to fit.


I see that you updated your question a bit to say you're using HSQLDB and Hibernate. I would venture a guess that your performance problems are more likely due to Hibernate, rather than HSQLDB.

According to http://en.wikipedia.org/wiki/HSQLDB, the choice of table type can have a great impact on performance, as well...

Mark Bessey
A: 

If you know for certain that it will be read-only, you can index the tables more aggressively. Generally speaking, indexes slow writes and speed up reads.

It would also be worthwhile to learn the performance characteristics of the RDBMS you are using. You will want to avoid anything that will cause the query analyzer to parse inside a field- i.e. LIKE comparisons, Regex, XML datatypes, substrings, etc.

You want to make sure any fields used as criteria in the WHERE clause are indexed and you are using simple '=' evaluations. If that is awkward in the current schema, it's probably worth it to split the data up differently to get to that state.

JSacksteder