A method of reorganizing a tablespace in a database may include reading a
row of data from the database, analyzing the row of data read out from
the database, determining whether to eliminate or retain the row of data
based on at least one predetermined rule, reloading the row of data into
the database when it is determined that the row of data complies with the
at least one predetermined rule, eliminating the row of data when it is
determined that the row of data does not comply with the at least one
predetermined rule, and rebuilding an index related to the database to
include keys that correspond to the reloaded row of data. The
determining, reloading, eliminating and rebuilding steps are repeated for
each row of data in the database.