Sedillo, Derek (Mission Systems) wrote:
There are no foreign keys or triggers on the tables. But there are
indexes which might be slowing things down. So I might drop the indexes
and try running import again.
Just so you're aware, there is a known issue with Derby where creation of an
index before inserting data can lead to bad statistics and therefore bad
optimizer cost estimates, thus resulting in poor performance. See DERBY-269.
Or put another way, it's best to insert the data first and *then* create the
indexes.
So even if it doesn't speed up the import operation itself, it is still a good
idea to insert data first and create indexes afterward. Doing so will help the
optimizer find better plans for subsequent queries against the relevant tables.
Army