speedup of database random point routine