database speed improvements