Code to keep database under 10,000 row limit by deleting rows referenced least recently.