[fix bug 907938] DB optimizations in voting app.