# Shut down the system properly

If your application shuts down the database in an orderly fashion, it can reduce the amount of work that the database has to do to start up again after an unexpected exit.

Derby features crash recovery that restores the state of committed transactions in the event that the database exits unexpectedly, for example during a power failure. The recovery processing happens the next time the database is started after the unexpected exit. Your application can reduce the amount of work that the database has to do to start up the next time by shutting it down in an orderly fashion. See "Shutting down Derby or an individual database" in the Derby Developer's Guide.

The Derby utilities all perform an orderly shutdown.

Parent topic: Performance tips and tricks
Related concepts
Use prepared statements with substitution parameters
Create indexes, and make sure they are being used
Ensure that table statistics are accurate
Increase the size of the data page cache
Tune the size of database pages
Avoid expensive queries
Use the appropriate getXXX and setXXX methods for the type
Tune database booting/class loading
Avoid inserts in autocommit mode if possible
Improve the performance of table functions
Configure Derby to use an in-memory database
Increase the concurrency of sequences
Put Derby first in your classpath