1. As I said, the
added and
lastseen indexes are used only ONCE A DAY. The admin might go to the IP Cache Log page and sort on those columns but how often will this happen? Once a week, once a month, once ever? Meanwhile, those indexes' binary trees are rebuilt or rebuilt (HUNDREDS OF) THOUSANDS OF TIMES per day. The overhead does not justify the presumed benefit. These two indexes slow the site down. A lot.
2. Point taken; You are right.
3. Ah I didn't look at
avh-fdas.public.php before..... Sorry, why would you delete the IPs that have potentially just revisited an hour ago? If I visit the blog consistently once a day, why would you delete my IP after
daystokeep? Sorry I don't understand; Deleting by
lastseen makes a lot more sense.
4. I didn't tell you to eliminate the IP cache log. I meant supplement the SQL-based IP cache log with a memory-based array. I didn't tell you to store the IP cache log in memory. I meant cache a few IPs using the Transients API. The memory tradeoff is very small; each array element is just a few bytes long. 10KB of RAM can cache at least 30 IPs. If the blog has less than 30 unique visitors at a time, you save up to 97% of your MySQL calls. Even if
lastseen won't be accurate, the improvement is worth it.
4. Using the Transients API does not produce additional MySQL calls. When WordPress loads, WordPress calls
wp_load_alloptions which loads all autoloaded WordPress settings (including AVHFDAS's) and also all transient API data. Furthermore, a memcached plugin, for example, would make WordPress store transient values in fast memory instead of in the database.
4. Searching through an in-memory array is always faster than a MySQL call. Always.
5. I know.

I just gave you a point to ponder that we are storing our visitor IPs in plaintext and they are readable by and vulnerable to any third-party plugin.