Down sampling of data in the database.