agi: New routine to truncate the database file by removing unused space