Skip to content

Instantly share code, notes, and snippets.

@BohuTANG
Created October 13, 2022 00:24
Show Gist options
  • Save BohuTANG/87801aaf412239af9623934f356c75bf to your computer and use it in GitHub Desktop.
Save BohuTANG/87801aaf412239af9623934f356c75bf to your computer and use it in GitHub Desktop.
databend-fd-issue
Table:
```
create table t7861(
c1 VARCHAR NULL,
c2 VARCHAR NULL,
c3 VARCHAR NULL,
c4 VARCHAR NULL,
c5 VARCHAR NULL,
c6 VARCHAR NULL,
c7 VARCHAR NULL,
c8 BIGINT UNSIGNED NULL,
c9 BIGINT UNSIGNED NULL,
c10 VARCHAR NULL,
c11 VARCHAR NULL,
c12 VARCHAR NULL,
c13 VARCHAR NULL,
c14 VARCHAR NULL,
c15 VARCHAR NULL,
c16 VARCHAR NULL,
c17 VARCHAR NULL,
c18 VARCHAR NULL,
c19 VARCHAR NULL,
c20 VARCHAR NULL,
c21 VARCHAR NULL,
c22 OBJECT NULL,
c23 OBJECT NULL,
c24 VARCHAR NULL,
c25 VARCHAR NULL,
c26 VARCHAR NULL
);
```
pip3 install mysql-connector-python
```
#!/usr/bin/env python
import mysql.connector
import time
import string
import random
N=30
cnx = mysql.connector.connect(
host='127.0.0.1',
port=3307,
user='root',
password='root',
database='db7861'
)
# Gets the versio
cs = cnx.cursor()
try:
for i in range(0, 100000000):
t1 = time.time()
c1 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=N))
c2 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=N))
c3 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=N))
c4 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=N))
c5 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=N))
c6 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=N))
c7 = ''.join(random.choices(string.ascii_uppercase + string.digits, k=N))
c8 = 1
c9 = 2
sql="insert into db7861.t7861 (c1, c2, c3, c4,c5,c6,c7) values('%s','%s', '%s', '%s', '%s', '%s', '%s')"%(c1,c2,c3,c4,c5,c6,c7)
cs.execute(sql)
t2 = time.time()
print("%d:%f"%(i,t2-t1))
finally:
cs.close()
cnx.close()
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment