|
MySQL两种表存储结构MyISAM和InnoDB的性能比较测试(4) sys.exit(1) else: c = mdb.cursor() table,autocommit,trans = test starttime = time.time() print table," ",time.strftime("%y-%m-%d %H:%M:%S",time.localtime()) if autocommit != None: AutoCommit(autocommit) if trans == 1: BeginTrans() for i in xrange(testcount): tablestring = "%020d"%i if (AddTable(table,tableid,tablestring)<1): print "AddTable Error",tablestring if trans == 1: Commit() print time.strftime("%y-%m-%d %H:%M:%S",time.localtime()) endtime = time.time() usedtime = endtime-starttime print table,"count:",getcount(table)," used time:",usedtime c.close() mdb.close()
|