greatly improve autoupdate (query was taking too long)