def processInput(users):
sql_1 = "SELECT * FROM table1"
cursor.execute(sql_1)
res_1 = cursor.fetchall()
print(res_1)
sql_2 = "SELECT * FROM table2"
cursor.execute(sql_2)
res_2 = cursor.fetchall()
print(res_2)
pool = Pool(processes=8)
for _ in tqdm.tqdm(pool.imap_unordered(processInput, users), total=len(users)):
pass