Ok!!
Having indexes will slow down an insert statement. Why? The database has to write an extra
entry into an index for each insert. Depending on indexed column, this may also slow down
update statements.
Using transacttions is even worse. The database must write into a transaction log to be
able to do a rollback if necessary.
Using sequences instead of an id generated by Java. Yes, a little bit of course. For each
insert statement, Hibernate must query the database for the next sequence number, or
hibernate must update the Java object with the new sequence number set by the database
using an sql query.
In general all SQL databases are slow when it comes to disk io, i.e. taking care of the
data. The data files are normally not optimized for either reading and/or writing. A
relation database will force the disk to move the read head, which is a physical movement,
serveral times on the disk for each data read/write operation. Indexes are normally read
into memory, but the data has to be read/written. This is why realtion database are fast
in finding items (in memory index lookup) but relatively slow when it comes to
fetching/writing data.
Regards
Oskar
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039823#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...