question: void purgeLastArticles ( int amountToPurge ) { if ( ! isDBAvailable ( ) ) return ; long time = System . currentTimeMillis ( ) ; String query = "_id IN ( SELECT _id FROM " + TABLE_ARTICLES + " WHERE isPublished=0 AND isStarred=0 ORDER BY updateDate DESC LIMIT -1 OFFSET " + ( Utils . ARTICLE_LIMIT - amountToPurge + ")" ) ; safelyDeleteArticles ( query , null ) ; Log . d ( TAG , "purgeLastArticles took " + ( System . currentTimeMillis ( ) - time ) + "ms" ) ; }
target:  Delete given amount of last updated articles from DB. Published and Starred articles are ignored so the configured limit is not an exact upper limit to the number of articles in the database.