#!/usr/bin/env python import sys,random i = 500000 if len(sys.argv) > 1: table = sys.argv[1] else: table = "sdst" print """ CREATE TABLE %s ( I INT default NULL auto_increment, A INT, B INT, C INT, PRIMARY KEY(I) ); """ % (table) while (i > 0): A = random.randint(0, 100000) B = random.randint(0, 100000) C = A + B print "INSERT DELAYED INTO %s (A, B, C) VALUES (%d, %d, %d);" % (table, A, B, C) i -= 1