Smart truncate