#!/usr/bin/python
import sqlite3
import random
from datetime import datetime
conn = sqlite3.connect('sqlite.db')
cur = conn.cursor()
startTime = datetime.now()
for i in range(1,1000):
x = random.randint(1,10000000)
cur.execute('SELECT * FROM t WHERE id=?', (x,))
cur.fetchall()
print(datetime.now()-startTime)
#!/usr/bin/python
import redis
import random
from datetime import datetime
r = redis.StrictRedis(host='127.0.0.1', port=6379, db=0)
startTime = datetime.now()
for i in range(1,1000):
x = random.randint(1,10000000)
r.zscore('queue',x)
print(datetime.now()-startTime)