1. A method comprising: tracking a plurality of queries executing in a database system; selecting a query with a longest duration; and calculating undo retention duration of the system for supporting the longest query.