Database restructuring