'DAL query peak performance'

def testDBSelect(self):

    db = current.db
    s3db = current.s3db
    print ''
    table = s3db.table('pr_person')
    x = (lambda : [(row.first_name, row.last_name) for row in db((table.id > 0)).select(table.id, table.first_name, table.last_name, limitby=(0, 50))])
    n = len(x())
    mlt = timeit.Timer(x).timeit(number=int((100 / n)))
    print ('db.select    =    %s    ms/record    (=%s    rec/sec)' % ((mlt * 10.0), int((100 / mlt))))
    x = (lambda : [[(row.first_name, row.last_name) for row in db((table.id < i)).select(table.id, table.first_name, table.last_name)] for i in xrange(n)])
    mlt = (timeit.Timer(x).timeit(number=10) * (100 / n))
    print ('db.select    =    %s    ms/query    (=%s    q/sec)' % (mlt, int((1000 / mlt))))
