redis之十五(游标迭代器(过滤器)——Scan)

一个问题引发的「血案」

曾经发生过这样一件事,我们的 Redis 服务器存储了海量的数据,其中登录用户信息是以 user_token_id 的形式存储的。运营人员想要当前所有的用户登录信息,然后悲剧就发生了:因为我们的工程师使用了 keys user_token_* 来查询对应的用户,结果导致 Redis 假死不可用,以至于影响到线上的其他业务接连发生问题,然后就收到了一堆的系统预警短信。并且这个假死的时间是和存储的数据成正比的,数据量越大假死的时间就越长,导致的故障时间也越长。

那如何避免这个问题呢?

问题的解决方案

在 Redis 2.8 之前,我们只能使用 keys 命令来查询我们想要的数据,但这个命令存在两个缺点:

  1. 此命令没有分页功能,我们只能一次性查询出所有符合条件的 key 值,如果查询结果非常巨大,那么得到的输出信息也会非常多;
  2. keys 命令是遍历查询,因此它的查询时间复杂度是 o(n),所以数据量越大查询时间就越长。

然而,比较幸运的是在 Redis 2.8 时推出了 Scan,解决了我们这些问题,下面来看 Scan 的具体使用。

Scan 命令使用

我们先来模拟海量数据,使用 Pipeline 添加 10w 条数据,Python 代码实现如下:

from redis import StrictRedis

redis_cli = StrictRedis(host="xx", port=xx, password="xx", db=xx, decode_responses=True)


def insert_many_string():
    pipe = redis_cli.pipeline()
    for i in range(100000):
        pipe.set("t_" + str(i), i)
    pipe.execute()
    print("success")

我们来查询用户 id 为 9999* 的数据,Scan 命令使用如下:

127.0.0.1:6380[15]> scan 0 match t_9999* count 20000
1) "15180"
2) 1) "t_99992"
127.0.0.1:6380[15]> scan 15180 match t_9999* count 20000
1) "109670"
2) 1) "t_99995"
   2) "t_99998"
   3) "t_99991"
127.0.0.1:6380[15]> scan 109670 match t_9999* count 20000
1) "34457"
2) 1) "t_99997"
   2) "t_9999"
   3) "t_99990"
127.0.0.1:6380[15]> scan 34457 match t_9999* count 20000
1) "22835"
2) 1) "t_99996"
   2) "t_99999"
127.0.0.1:6380[15]> scan 22835 match t_9999* count 20000
1) "32767"
2) 1) "t_99993"
   2) "t_99994"
127.0.0.1:6380[15]> scan 32767 match t_9999* count 20000
1) "0"
2) (empty list or set)

从以上的执行结果,我们看出两个问题:

  1. 查询的结果为空,但游标值不为 0,表示遍历还没结束;
  2. 设置的是 count 10000,但每次返回的数量都不是 10000,且不固定,这是因为 count 只是限定服务器单次遍历的字典槽位数量(约等于),而不是规定返回结果的 count 值。

相关语法:

scan cursor [MATCH pattern] [COUNT count]

其中:

  • cursor:光标位置,整数值,从 0 开始,到 0 结束,查询结果是空,但游标值不为 0,表示遍历还没结束;
  • match pattern:正则匹配字段;
  • count:限定服务器单次遍历的字典槽位数量(约等于),只是对增量式迭代命令的一种提示(hint),并不是查询结果返回的最大数量,它的默认值是 10。

代码实战

本文我们使用 Pthon 代码来实现 Scan 的查询功能,代码如下:

def use_scan():
    cursor = 0
    match = "t_9999*"
    count = 20000
    res = redis_cli.scan(cursor, match, count)
    print("first result: >>>>", res)
    while True:
        if res[0] != 0:
            cursor = res[0]
            res = redis_cli.scan(cursor, match, count)
            print("next result: >>>", res)
        else:
            break

以上程序执行结果如下: 

 first result: >>>> (15180, ['t_99992'])
next result: >>> (109670, ['t_99995', 't_99998', 't_99991'])
next result: >>> (34457, ['t_99997', 't_9999', 't_99990'])
next result: >>> (22835, ['t_99996', 't_99999'])
next result: >>> (32767, ['t_99993', 't_99994'])
next result: >>> (0, [])

Scan 相关命令

Scan 是一个系列指令,除了 Scan 之外,还有以下 3 个命令:

  1. HScan 遍历字典游标迭代器
  2. SScan 遍历集合的游标迭代器
  3. ZScan 遍历有序集合的游标迭代器

来看这些命令的具体使用。

HScan 使用

def insert_many_hash():
    # 插入多个键值对
    pipe = redis_cli.pipeline()
    for i in range(2000):
        pipe.hset("hscan", "hk" + str(i), i)
    pipe.execute()

def test_hscan():
    # 使用hscan查询
    cursor = 0
    match = "hk*"
    count = 300
    res = redis_cli.hscan("hscan", cursor, match, count)
    print("first res : >>>", res)
    while True:
        if res[0] != 0:
            cursor = res[0]
            res = redis_cli.hscan("hscan", cursor, match, count)
            print("next res : >>>", res)
        else:
            break

以上程序执行结果如下: 

first res : >>> (420, {'hk1446': '1446', 'hk962': '962', 'hk300': '300', 'hk917': '917', 'hk905': '905', 'hk1837': '1837', 'hk576': '576', 'hk80': '80', 'hk838': '838', 'hk1374': '1374', 'hk1335': '1335', 'hk385': '385', 'hk924': '924', 'hk36': '36', 'hk641': '641', 'hk1457': '1457', 'hk1213': '1213', 'hk715': '715', 'hk864': '864', 'hk1957': '1957', 'hk161': '161', 'hk271': '271', 'hk1516': '1516', 'hk1331': '1331', 'hk13': '13', 'hk738': '738', 'hk433': '433', 'hk239': '239', 'hk945': '945', 'hk11': '11', 'hk63': '63', 'hk653': '653', 'hk1392': '1392', 'hk188': '188', 'hk1321': '1321', 'hk1133': '1133', 'hk315': '315', 'hk1514': '1514', 'hk143': '143', 'hk1533': '1533', 'hk1747': '1747', 'hk521': '521', 'hk604': '604', 'hk658': '658', 'hk114': '114', 'hk1005': '1005', 'hk1793': '1793', 'hk621': '621', 'hk1244': '1244', 'hk1724': '1724', 'hk311': '311', 'hk676': '676', 'hk1088': '1088', 'hk923': '923', 'hk118': '118', 'hk1830': '1830', 'hk1959': '1959', 'hk1146': '1146', 'hk1248': '1248', 'hk1487': '1487', 'hk400': '400', 'hk531': '531', 'hk111': '111', 'hk1927': '1927', 'hk49': '49', 'hk1357': '1357', 'hk916': '916', 'hk402': '402', 'hk936': '936', 'hk396': '396', 'hk994': '994', 'hk1137': '1137', 'hk1640': '1640', 'hk1405': '1405', 'hk627': '627', 'hk75': '75', 'hk246': '246', 'hk1013': '1013', 'hk887': '887', 'hk1203': '1203', 'hk1184': '1184', 'hk790': '790', 'hk594': '594', 'hk933': '933', 'hk977': '977', 'hk56': '56', 'hk467': '467', 'hk1081': '1081', 'hk1932': '1932', 'hk1193': '1193', 'hk195': '195', 'hk930': '930', 'hk851': '851', 'hk902': '902', 'hk1269': '1269', 'hk1990': '1990', 'hk906': '906', 'hk1233': '1233', 'hk1871': '1871', 'hk577': '577', 'hk473': '473', 'hk105': '105', 'hk384': '384', 'hk470': '470', 'hk926': '926', 'hk196': '196', 'hk1450': '1450', 'hk1682': '1682', 'hk990': '990', 'hk292': '292', 'hk774': '774', 'hk557': '557', 'hk1101': '1101', 'hk1712': '1712', 'hk605': '605', 'hk1115': '1115', 'hk439': '439', 'hk421': '421', 'hk79': '79', 'hk826': '826', 'hk673': '673', 'hk1348': '1348', 'hk1798': '1798', 'hk946': '946', 'hk50': '50', 'hk1451': '1451', 'hk1340': '1340', 'hk193': '193', 'hk221': '221', 'hk727': '727', 'hk897': '897', 'hk1803': '1803', 'hk252': '252', 'hk128': '128', 'hk908': '908', 'hk1109': '1109', 'hk1791': '1791', 'hk1710': '1710', 'hk634': '634', 'hk1071': '1071', 'hk380': '380', 'hk214': '214', 'hk1079': '1079', 'hk1056': '1056', 'hk1014': '1014', 'hk327': '327', 'hk970': '970', 'hk339': '339', 'hk1346': '1346', 'hk409': '409', 'hk43': '43', 'hk1422': '1422', 'hk969': '969', 'hk961': '961', 'hk1347': '1347', 'hk603': '603', 'hk318': '318', 'hk788': '788', 'hk1317': '1317', 'hk1896': '1896', 'hk3': '3', 'hk466': '466', 'hk638': '638', 'hk568': '568', 'hk581': '581', 'hk804': '804', 'hk15': '15', 'hk748': '748', 'hk1838': '1838', 'hk1279': '1279', 'hk260': '260', 'hk1881': '1881', 'hk1389': '1389', 'hk302': '302', 'hk197': '197', 'hk1181': '1181', 'hk1168': '1168', 'hk1677': '1677', 'hk754': '754', 'hk1930': '1930', 'hk1666': '1666', 'hk1209': '1209', 'hk1560': '1560', 'hk1879': '1879', 'hk68': '68', 'hk1151': '1151', 'hk1136': '1136', 'hk1548': '1548', 'hk1613': '1613', 'hk317': '317', 'hk1318': '1318', 'hk225': '225', 'hk278': '278', 'hk1142': '1142', 'hk1825': '1825', 'hk1786': '1786', 'hk8': '8', 'hk892': '892', 'hk1057': '1057', 'hk1615': '1615', 'hk463': '463', 'hk1217': '1217', 'hk1949': '1949', 'hk670': '670', 'hk1090': '1090', 'hk352': '352', 'hk259': '259', 'hk739': '739', 'hk23': '23', 'hk272': '272', 'hk796': '796', 'hk1021': '1021', 'hk373': '373', 'hk589': '589', 'hk1499': '1499', 'hk1127': '1127', 'hk764': '764', 'hk224': '224', 'hk112': '112', 'hk509': '509', 'hk588': '588', 'hk1433': '1433', 'hk1328': '1328', 'hk590': '590', 'hk1238': '1238', 'hk501': '501', 'hk1053': '1053', 'hk1461': '1461', 'hk1471': '1471', 'hk1631': '1631', 'hk1792': '1792', 'hk1728': '1728', 'hk1390': '1390', 'hk1846': '1846', 'hk1781': '1781', 'hk1581': '1581', 'hk241': '241', 'hk664': '664', 'hk1044': '1044', 'hk18': '18', 'hk1925': '1925', 'hk1831': '1831', 'hk740': '740', 'hk65': '65', 'hk1597': '1597', 'hk1503': '1503', 'hk713': '713', 'hk1258': '1258', 'hk124': '124', 'hk1890': '1890', 'hk205': '205', 'hk963': '963', 'hk686': '686', 'hk1914': '1914', 'hk337': '337', 'hk1769': '1769', 'hk1085': '1085', 'hk1359': '1359', 'hk184': '184', 'hk1694': '1694', 'hk1473': '1473', 'hk1095': '1095', 'hk1164': '1164', 'hk736': '736', 'hk397': '397', 'hk1192': '1192', 'hk1600': '1600', 'hk164': '164', 'hk1200': '1200', 'hk1977': '1977', 'hk513': '513', 'hk721': '721', 'hk1929': '1929', 'hk1910': '1910', 'hk273': '273', 'hk233': '233', 'hk841': '841', 'hk1749': '1749', 'hk752': '752', 'hk1126': '1126', 'hk820': '820', 'hk1984': '1984', 'hk47': '47', 'hk257': '257', 'hk751': '751', 'hk398': '398', 'hk484': '484', 'hk907': '907', 'hk1997': '1997', 'hk108': '108', 'hk1832': '1832', 'hk69': '69', 'hk882': '882', 'hk1371': '1371', 'hk706': '706', 'hk708': '708', 'hk698': '698', 'hk901': '901', 'hk1802': '1802', 'hk1237': '1237'})
next res : >>> (2002, {'hk1970': '1970', 'hk394': '394', 'hk1010': '1010', 'hk564': '564', 'hk412': '412', 'hk1858': '1858', 'hk358': '358', 'hk165': '165', 'hk200': '200', 'hk190': '190', 'hk587': '587', 'hk1552': '1552', 'hk1537': '1537', 'hk651': '651', 'hk381': '381', 'hk1982': '1982', 'hk159': '159', 'hk646': '646', 'hk1199': '1199', 'hk822': '822', 'hk1679': '1679', 'hk453': '453', 'hk335': '335', 'hk1360': '1360', 'hk1314': '1314', 'hk452': '452', 'hk1725': '1725', 'hk1716': '1716', 'hk547': '547', 'hk46': '46', 'hk1787': '1787', 'hk1310': '1310', 'hk1049': '1049', 'hk298': '298', 'hk1438': '1438', 'hk729': '729', 'hk306': '306', 'hk1783': '1783', 'hk1737': '1737', 'hk1732': '1732', 'hk281': '281', 'hk1119': '1119', 'hk735': '735', 'hk427': '427', 'hk1355': '1355', 'hk1040': '1040', 'hk1571': '1571', 'hk1163': '1163', 'hk270': '270', 'hk537': '537', 'hk1839': '1839', 'hk525': '525', 'hk543': '543', 'hk82': '82', 'hk16': '16', 'hk1052': '1052', 'hk853': '853', 'hk898': '898', 'hk491': '491', 'hk106': '106', 'hk575': '575', 'hk1874': '1874', 'hk483': '483', 'hk210': '210', 'hk1667': '1667', 'hk343': '343', 'hk1693': '1693', 'hk1652': '1652', 'hk1543': '1543', 'hk692': '692', 'hk1401': '1401', 'hk702': '702', 'hk679': '679', 'hk1668': '1668', 'hk1215': '1215', 'hk1505': '1505', 'hk1298': '1298', 'hk876': '876', 'hk1502': '1502', 'hk1442': '1442', 'hk1382': '1382', 'hk1128': '1128', 'hk178': '178', 'hk1757': '1757', 'hk1327': '1327', 'hk1068': '1068', 'hk477': '477', 'hk101': '101', 'hk1343': '1343', 'hk763': '763', 'hk1004': '1004', 'hk1958': '1958', 'hk682': '682', 'hk1569': '1569', 'hk78': '78', 'hk914': '914', 'hk308': '308', 'hk296': '296', 'hk103': '103', 'hk1246': '1246', 'hk1226': '1226', 'hk789': '789', 'hk123': '123', 'hk1230': '1230', 'hk1319': '1319', 'hk207': '207', 'hk705': '705', 'hk1272': '1272', 'hk935': '935', 'hk1886': '1886', 'hk1462': '1462', 'hk642': '642', 'hk1444': '1444', 'hk480': '480', 'hk1093': '1093', 'hk544': '544', 'hk87': '87', 'hk1036': '1036', 'hk256': '256', 'hk1174': '1174', 'hk1324': '1324', 'hk1828': '1828', 'hk297': '297', 'hk1460': '1460', 'hk1766': '1766', 'hk697': '697', 'hk70': '70', 'hk1876': '1876', 'hk1262': '1262', 'hk1780': '1780', 'hk7': '7', 'hk1111': '1111', 'hk704': '704', 'hk983': '983', 'hk1522': '1522', 'hk1880': '1880', 'hk1251': '1251', 'hk1121': '1121', 'hk1844': '1844', 'hk778': '778', 'hk1255': '1255', 'hk1817': '1817', 'hk1286': '1286', 'hk596': '596', 'hk1806': '1806', 'hk1299': '1299', 'hk1160': '1160', 'hk1595': '1595', 'hk149': '149', 'hk615': '615', 'hk1190': '1190', 'hk1857': '1857', 'hk813': '813', 'hk893': '893', 'hk737': '737', 'hk1291': '1291', 'hk1204': '1204', 'hk1152': '1152', 'hk171': '171', 'hk295': '295', 'hk481': '481', 'hk1469': '1469', 'hk462': '462', 'hk226': '226', 'hk1848': '1848', 'hk29': '29', 'hk625': '625', 'hk144': '144', 'hk968': '968', 'hk526': '526', 'hk1815': '1815', 'hk1704': '1704', 'hk672': '672', 'hk1464': '1464', 'hk1673': '1673', 'hk1705': '1705', 'hk749': '749', 'hk1480': '1480', 'hk146': '146', 'hk370': '370', 'hk1567': '1567', 'hk899': '899', 'hk493': '493', 'hk1396': '1396', 'hk1377': '1377', 'hk1889': '1889', 'hk107': '107', 'hk145': '145', 'hk437': '437', 'hk407': '407', 'hk1023': '1023', 'hk1414': '1414', 'hk1398': '1398', 'hk885': '885', 'hk345': '345', 'hk9': '9', 'hk699': '699', 'hk1801': '1801', 'hk1353': '1353', 'hk1144': '1144', 'hk971': '971', 'hk1738': '1738', 'hk775': '775', 'hk74': '74', 'hk1681': '1681', 'hk20': '20', 'hk1303': '1303', 'hk1148': '1148', 'hk177': '177', 'hk215': '215', 'hk1531': '1531', 'hk1113': '1113', 'hk1720': '1720', 'hk640': '640', 'hk835': '835', 'hk848': '848', 'hk1129': '1129', 'hk66': '66', 'hk1065': '1065', 'hk631': '631', 'hk55': '55', 'hk136': '136', 'hk1643': '1643', 'hk875': '875', 'hk1393': '1393', 'hk1921': '1921', 'hk1424': '1424', 'hk1026': '1026', 'hk619': '619', 'hk687': '687', 'hk1210': '1210', 'hk1572': '1572', 'hk1917': '1917', 'hk1421': '1421', 'hk643': '643', 'hk1579': '1579', 'hk532': '532', 'hk654': '654', 'hk1556': '1556', 'hk223': '223', 'hk1267': '1267', 'hk560': '560', 'hk1629': '1629', 'hk614': '614', 'hk1991': '1991', 'hk1526': '1526', 'hk67': '67', 'hk166': '166', 'hk1731': '1731', 'hk1653': '1653', 'hk666': '666', 'hk1100': '1100', 'hk1590': '1590', 'hk172': '172', 'hk115': '115', 'hk1776': '1776', 'hk1774': '1774', 'hk657': '657', 'hk1232': '1232', 'hk307': '307', 'hk1764': '1764', 'hk1162': '1162', 'hk1808': '1808', 'hk492': '492', 'hk1441': '1441', 'hk821': '821', 'hk1642': '1642', 'hk569': '569', 'hk304': '304', 'hk1385': '1385', 'hk323': '323', 'hk973': '973', 'hk1463': '1463', 'hk811': '811', 'hk1620': '1620', 'hk565': '565', 'hk694': '694', 'hk1689': '1689', 'hk250': '250', 'hk1483': '1483', 'hk844': '844', 'hk1979': '1979', 'hk785': '785', 'hk406': '406', 'hk369': '369', 'hk194': '194', 'hk1610': '1610', 'hk422': '422', 'hk490': '490', 'hk1341': '1341', 'hk780': '780', 'hk800': '800', 'hk1602': '1602', 'hk1539': '1539', 'hk803': '803', 'hk976': '976', 'hk1500': '1500', 'hk996': '996', 'hk1493': '1493', 'hk1412': '1412'})
next res : >>> (1806, {'hk365': '365', 'hk363': '363', 'hk211': '211', 'hk807': '807', 'hk1475': '1475', 'hk743': '743', 'hk1361': '1361', 'hk1648': '1648', 'hk1410': '1410', 'hk62': '62', 'hk1762': '1762', 'hk726': '726', 'hk1091': '1091', 'hk216': '216', 'hk966': '966', 'hk498': '498', 'hk1141': '1141', 'hk130': '130', 'hk1993': '1993', 'hk133': '133', 'hk1960': '1960', 'hk1099': '1099', 'hk1743': '1743', 'hk1332': '1332', 'hk1906': '1906', 'hk1369': '1369', 'hk1094': '1094', 'hk76': '76', 'hk1325': '1325', 'hk1086': '1086', 'hk1553': '1553', 'hk1015': '1015', 'hk359': '359', 'hk912': '912', 'hk1761': '1761', 'hk620': '620', 'hk799': '799', 'hk1120': '1120', 'hk451': '451', 'hk85': '85', 'hk1270': '1270', 'hk1713': '1713', 'hk1498': '1498', 'hk1364': '1364', 'hk583': '583', 'hk1467': '1467', 'hk1306': '1306', 'hk1907': '1907', 'hk475': '475', 'hk1296': '1296', 'hk264': '264', 'hk1330': '1330', 'hk877': '877', 'hk1758': '1758', 'hk0': '0', 'hk1683': '1683', 'hk1614': '1614', 'hk542': '542', 'hk441': '441', 'hk1885': '1885', 'hk649': '649', 'hk662': '662', 'hk1051': '1051', 'hk529': '529', 'hk847': '847', 'hk154': '154', 'hk816': '816', 'hk1278': '1278', 'hk944': '944', 'hk1045': '1045', 'hk1143': '1143', 'hk1964': '1964', 'hk998': '998', 'hk1981': '1981', 'hk1862': '1862', 'hk1138': '1138', 'hk1912': '1912', 'hk1218': '1218', 'hk1818': '1818', 'hk1840': '1840', 'hk1638': '1638', 'hk41': '41', 'hk1618': '1618', 'hk1139': '1139', 'hk446': '446', 'hk1406': '1406', 'hk325': '325', 'hk1772': '1772', 'hk1540': '1540', 'hk377': '377', 'hk1672': '1672', 'hk849': '849', 'hk158': '158', 'hk601': '601', 'hk1623': '1623', 'hk1131': '1131', 'hk552': '552', 'hk584': '584', 'hk251': '251', 'hk320': '320', 'hk585': '585', 'hk110': '110', 'hk1436': '1436', 'hk1936': '1936', 'hk1408': '1408', 'hk894': '894', 'hk1980': '1980', 'hk253': '253', 'hk379': '379', 'hk967': '967', 'hk561': '561', 'hk1661': '1661', 'hk181': '181', 'hk611': '611', 'hk1260': '1260', 'hk1239': '1239', 'hk497': '497', 'hk1492': '1492', 'hk129': '129', 'hk1486': '1486', 'hk784': '784', 'hk559': '559', 'hk5': '5', 'hk801': '801', 'hk139': '139', 'hk1707': '1707', 'hk511': '511', 'hk1609': '1609', 'hk1900': '1900', 'hk160': '160', 'hk1663': '1663', 'hk622': '622', 'hk1994': '1994', 'hk1568': '1568', 'hk72': '72', 'hk312': '312', 'hk866': '866', 'hk512': '512', 'hk486': '486', 'hk1287': '1287', 'hk277': '277', 'hk1294': '1294', 'hk1841': '1841', 'hk1282': '1282', 'hk231': '231', 'hk1647': '1647', 'hk417': '417', 'hk1608': '1608', 'hk910': '910', 'hk147': '147', 'hk469': '469', 'hk650': '650', 'hk1425': '1425', 'hk747': '747', 'hk1038': '1038', 'hk1800': '1800', 'hk1283': '1283', 'hk1867': '1867', 'hk1607': '1607', 'hk1402': '1402', 'hk1106': '1106', 'hk1821': '1821', 'hk606': '606', 'hk1411': '1411', 'hk1256': '1256', 'hk1565': '1565', 'hk719': '719', 'hk725': '725', 'hk1198': '1198', 'hk951': '951', 'hk1864': '1864', 'hk932': '932', 'hk1523': '1523', 'hk1922': '1922', 'hk1547': '1547', 'hk955': '955', 'hk1316': '1316', 'hk24': '24', 'hk61': '61', 'hk815': '815', 'hk1235': '1235', 'hk675': '675', 'hk972': '972', 'hk1494': '1494', 'hk93': '93', 'hk212': '212', 'hk610': '610', 'hk478': '478', 'hk35': '35', 'hk836': '836', 'hk1767': '1767', 'hk174': '174', 'hk1481': '1481', 'hk263': '263', 'hk765': '765', 'hk1134': '1134', 'hk549': '549', 'hk1016': '1016', 'hk1428': '1428', 'hk632': '632', 'hk693': '693', 'hk1937': '1937', 'hk1915': '1915', 'hk1819': '1819', 'hk401': '401', 'hk878': '878', 'hk1985': '1985', 'hk1454': '1454', 'hk1084': '1084', 'hk1536': '1536', 'hk38': '38', 'hk1542': '1542', 'hk554': '554', 'hk1779': '1779', 'hk652': '652', 'hk1734': '1734', 'hk548': '548', 'hk167': '167', 'hk1047': '1047', 'hk1718': '1718', 'hk734': '734', 'hk269': '269', 'hk1491': '1491', 'hk667': '667', 'hk655': '655', 'hk995': '995', 'hk444': '444', 'hk669': '669', 'hk829': '829', 'hk931': '931', 'hk461': '461', 'hk1242': '1242', 'hk1380': '1380', 'hk1247': '1247', 'hk1546': '1546', 'hk656': '656', 'hk1913': '1913', 'hk1067': '1067', 'hk454': '454', 'hk1104': '1104', 'hk1963': '1963', 'hk1973': '1973', 'hk294': '294', 'hk709': '709', 'hk440': '440', 'hk1974': '1974', 'hk1775': '1775', 'hk570': '570', 'hk779': '779', 'hk915': '915', 'hk1770': '1770', 'hk1221': '1221', 'hk1940': '1940', 'hk416': '416', 'hk1290': '1290', 'hk357': '357', 'hk341': '341', 'hk186': '186', 'hk802': '802', 'hk593': '593', 'hk1872': '1872', 'hk1975': '1975', 'hk1708': '1708', 'hk1702': '1702', 'hk855': '855', 'hk1686': '1686', 'hk629': '629', 'hk1664': '1664', 'hk1551': '1551', 'hk1953': '1953', 'hk1009': '1009', 'hk744': '744', 'hk199': '199', 'hk1455': '1455', 'hk1222': '1222', 'hk30': '30', 'hk1942': '1942', 'hk353': '353', 'hk1669': '1669', 'hk1518': '1518', 'hk746': '746', 'hk137': '137', 'hk1649': '1649', 'hk1466': '1466', 'hk1427': '1427', 'hk1078': '1078', 'hk472': '472', 'hk53': '53', 'hk722': '722', 'hk1723': '1723', 'hk1404': '1404', 'hk1472': '1472', 'hk872': '872', 'hk127': '127', 'hk1657': '1657', 'hk1895': '1895', 'hk724': '724', 'hk189': '189', 'hk1577': '1577', 'hk1527': '1527'})
next res : >>> (233, {'hk1777': '1777', 'hk1709': '1709', 'hk1697': '1697', 'hk201': '201', 'hk148': '148', 'hk1387': '1387', 'hk1087': '1087', 'hk1196': '1196', 'hk1178': '1178', 'hk711': '711', 'hk993': '993', 'hk1952': '1952', 'hk100': '100', 'hk639': '639', 'hk1865': '1865', 'hk975': '975', 'hk413': '413', 'hk191': '191', 'hk372': '372', 'hk418': '418', 'hk176': '176', 'hk1300': '1300', 'hk157': '157', 'hk457': '457', 'hk1601': '1601', 'hk1123': '1123', 'hk574': '574', 'hk1289': '1289', 'hk2': '2', 'hk1680': '1680', 'hk1650': '1650', 'hk265': '265', 'hk310': '310', 'hk1337': '1337', 'hk1308': '1308', 'hk659': '659', 'hk660': '660', 'hk289': '289', 'hk1622': '1622', 'hk985': '985', 'hk1312': '1312', 'hk1588': '1588', 'hk1261': '1261', 'hk731': '731', 'hk1898': '1898', 'hk1699': '1699', 'hk321': '321', 'hk791': '791', 'hk6': '6', 'hk202': '202', 'hk1525': '1525', 'hk607': '607', 'hk1288': '1288', 'hk1870': '1870', 'hk303': '303', 'hk771': '771', 'hk1089': '1089', 'hk756': '756', 'hk1311': '1311', 'hk1671': '1671', 'hk313': '313', 'hk949': '949', 'hk1995': '1995', 'hk1183': '1183', 'hk1733': '1733', 'hk1293': '1293', 'hk141': '141', 'hk89': '89', 'hk742': '742', 'hk770': '770', 'hk1074': '1074', 'hk1302': '1302', 'hk745': '745', 'hk1632': '1632', 'hk600': '600', 'hk208': '208', 'hk235': '235', 'hk1039': '1039', 'hk1617': '1617', 'hk1430': '1430', 'hk1058': '1058', 'hk730': '730', 'hk218': '218', 'hk1842': '1842', 'hk1358': '1358', 'hk507': '507', 'hk338': '338', 'hk163': '163', 'hk162': '162', 'hk222': '222', 'hk1391': '1391', 'hk1570': '1570', 'hk138': '138', 'hk1229': '1229', 'hk1511': '1511', 'hk1627': '1627', 'hk1519': '1519', 'hk349': '349', 'hk1338': '1338', 'hk456': '456', 'hk1186': '1186', 'hk628': '628', 'hk1259': '1259', 'hk1951': '1951', 'hk1829': '1829', 'hk1195': '1195', 'hk244': '244', 'hk1676': '1676', 'hk1988': '1988', 'hk1852': '1852', 'hk1763': '1763', 'hk644': '644', 'hk262': '262', 'hk1933': '1933', 'hk1753': '1753', 'hk1742': '1742', 'hk538': '538', 'hk1726': '1726', 'hk1882': '1882', 'hk891': '891', 'hk834': '834', 'hk1352': '1352', 'hk175': '175', 'hk1835': '1835', 'hk612': '612', 'hk733': '733', 'hk1582': '1582', 'hk1924': '1924', 'hk1530': '1530', 'hk1378': '1378', 'hk1158': '1158', 'hk424': '424', 'hk1285': '1285', 'hk1701': '1701', 'hk116': '116', 'hk228': '228', 'hk1938': '1938', 'hk227': '227', 'hk1919': '1919', 'hk1554': '1554', 'hk1170': '1170', 'hk1893': '1893', 'hk1175': '1175', 'hk1654': '1654', 'hk1578': '1578', 'hk1092': '1092', 'hk1696': '1696', 'hk1855': '1855', 'hk430': '430', 'hk1813': '1813', 'hk888': '888', 'hk819': '819', 'hk540': '540', 'hk1305': '1305', 'hk1646': '1646', 'hk98': '98', 'hk1750': '1750', 'hk333': '333', 'hk842': '842', 'hk1029': '1029', 'hk1274': '1274', 'hk1703': '1703', 'hk140': '140', 'hk1566': '1566', 'hk1759': '1759', 'hk562': '562', 'hk1812': '1812', 'hk831': '831', 'hk1972': '1972', 'hk261': '261', 'hk1891': '1891', 'hk792': '792', 'hk248': '248', 'hk1132': '1132', 'hk1520': '1520', 'hk1032': '1032', 'hk1902': '1902', 'hk117': '117', 'hk1227': '1227', 'hk762': '762', 'hk1592': '1592', 'hk1007': '1007', 'hk1295': '1295', 'hk432': '432', 'hk411': '411', 'hk1574': '1574', 'hk1947': '1947', 'hk1946': '1946', 'hk1103': '1103', 'hk131': '131', 'hk1351': '1351', 'hk685': '685', 'hk772': '772', 'hk113': '113', 'hk1624': '1624', 'hk450': '450', 'hk688': '688', 'hk1639': '1639', 'hk415': '415', 'hk618': '618', 'hk1342': '1342', 'hk305': '305', 'hk1603': '1603', 'hk582': '582', 'hk856': '856', 'hk1584': '1584', 'hk362': '362', 'hk1755': '1755', 'hk1966': '1966', 'hk442': '442', 'hk428': '428', 'hk597': '597', 'hk1756': '1756', 'hk1194': '1194', 'hk1943': '1943', 'hk290': '290', 'hk1108': '1108', 'hk952': '952', 'hk718': '718', 'hk1117': '1117', 'hk1363': '1363', 'hk1228': '1228', 'hk1944': '1944', 'hk1062': '1062', 'hk361': '361', 'hk293': '293', 'hk1983': '1983', 'hk1490': '1490', 'hk1452': '1452', 'hk1745': '1745', 'hk1275': '1275', 'hk1954': '1954', 'hk1479': '1479', 'hk220': '220', 'hk896': '896', 'hk1043': '1043', 'hk1349': '1349', 'hk617': '617', 'hk922': '922', 'hk830': '830', 'hk546': '546', 'hk510': '510', 'hk465': '465', 'hk1580': '1580', 'hk232': '232', 'hk119': '119', 'hk732': '732', 'hk1741': '1741', 'hk96': '96', 'hk151': '151', 'hk1397': '1397', 'hk495': '495', 'hk1878': '1878', 'hk823': '823', 'hk695': '695', 'hk1715': '1715', 'hk555': '555', 'hk1284': '1284', 'hk1521': '1521', 'hk1166': '1166', 'hk1899': '1899', 'hk1445': '1445', 'hk1820': '1820', 'hk52': '52', 'hk1541': '1541', 'hk992': '992', 'hk1655': '1655', 'hk99': '99', 'hk376': '376', 'hk1366': '1366', 'hk1850': '1850', 'hk1179': '1179', 'hk1171': '1171', 'hk1440': '1440', 'hk102': '102', 'hk663': '663', 'hk1768': '1768', 'hk957': '957', 'hk1711': '1711', 'hk1185': '1185', 'hk1076': '1076', 'hk865': '865', 'hk366': '366', 'hk1309': '1309', 'hk12': '12', 'hk368': '368', 'hk1432': '1432', 'hk671': '671', 'hk1851': '1851', 'hk818': '818', 'hk1987': '1987', 'hk445': '445', 'hk45': '45', 'hk1714': '1714', 'hk566': '566', 'hk795': '795', 'hk1245': '1245', 'hk1506': '1506', 'hk1447': '1447', 'hk1866': '1866', 'hk1853': '1853'})
next res : >>> (957, {'hk1484': '1484', 'hk1843': '1843', 'hk987': '987', 'hk1157': '1157', 'hk1928': '1928', 'hk1012': '1012', 'hk1046': '1046', 'hk948': '948', 'hk1011': '1011', 'hk1794': '1794', 'hk1606': '1606', 'hk279': '279', 'hk1322': '1322', 'hk1140': '1140', 'hk1465': '1465', 'hk1253': '1253', 'hk1240': '1240', 'hk1373': '1373', 'hk928': '928', 'hk434': '434', 'hk1849': '1849', 'hk1784': '1784', 'hk1470': '1470', 'hk988': '988', 'hk1468': '1468', 'hk942': '942', 'hk750': '750', 'hk1037': '1037', 'hk1591': '1591', 'hk236': '236', 'hk648': '648', 'hk34': '34', 'hk247': '247', 'hk280': '280', 'hk665': '665', 'hk840': '840', 'hk1268': '1268', 'hk1197': '1197', 'hk1063': '1063', 'hk1628': '1628', 'hk288': '288', 'hk1961': '1961', 'hk1276': '1276', 'hk1538': '1538', 'hk1911': '1911', 'hk1834': '1834', 'hk1687': '1687', 'hk443': '443', 'hk435': '435', 'hk1118': '1118', 'hk860': '860', 'hk1955': '1955', 'hk314': '314', 'hk420': '420', 'hk884': '884', 'hk169': '169', 'hk71': '71', 'hk1002': '1002', 'hk1394': '1394', 'hk1431': '1431', 'hk367': '367', 'hk1223': '1223', 'hk1264': '1264', 'hk1789': '1789', 'hk1719': '1719', 'hk1280': '1280', 'hk1208': '1208', 'hk54': '54', 'hk329': '329', 'hk918': '918', 'hk591': '591', 'hk701': '701', 'hk1489': '1489', 'hk1017': '1017', 'hk1736': '1736', 'hk438': '438', 'hk1544': '1544', 'hk204': '204', 'hk1748': '1748', 'hk267': '267', 'hk535': '535', 'hk1024': '1024', 'hk258': '258', 'hk814': '814', 'hk904': '904', 'hk1967': '1967', 'hk1956': '1956', 'hk1904': '1904', 'hk1999': '1999', 'hk563': '563', 'hk787': '787', 'hk953': '953', 'hk989': '989', 'hk1931': '1931', 'hk1370': '1370', 'hk1645': '1645', 'hk1636': '1636', 'hk121': '121', 'hk1760': '1760', 'hk1147': '1147', 'hk1205': '1205', 'hk626': '626', 'hk344': '344', 'hk1630': '1630', 'hk1315': '1315', 'hk1407': '1407', 'hk468': '468', 'hk956': '956', 'hk1901': '1901', 'hk553': '553', 'hk586': '586', 'hk810': '810', 'hk689': '689', 'hk1986': '1986', 'hk1517': '1517', 'hk1854': '1854', 'hk1236': '1236', 'hk1721': '1721', 'hk1532': '1532', 'hk395': '395', 'hk132': '132', 'hk1684': '1684', 'hk1495': '1495', 'hk282': '282', 'hk1172': '1172', 'hk64': '64', 'hk870': '870', 'hk890': '890', 'hk1055': '1055', 'hk1250': '1250', 'hk781': '781', 'hk773': '773', 'hk978': '978', 'hk921': '921', 'hk1333': '1333', 'hk4': '4', 'hk1225': '1225', 'hk533': '533', 'hk405': '405', 'hk1883': '1883', 'hk881': '881', 'hk683': '683', 'hk1006': '1006', 'hk217': '217', 'hk571': '571', 'hk249': '249', 'hk1549': '1549', 'hk1307': '1307', 'hk805': '805', 'hk514': '514', 'hk1191': '1191', 'hk494': '494', 'hk1989': '1989', 'hk58': '58', 'hk1573': '1573', 'hk423': '423', 'hk44': '44', 'hk832': '832', 'hk1935': '1935', 'hk156': '156', 'hk1892': '1892', 'hk1326': '1326', 'hk728': '728', 'hk458': '458', 'hk499': '499', 'hk1041': '1041', 'hk1695': '1695', 'hk1685': '1685', 'hk806': '806', 'hk168': '168', 'hk637': '637', 'hk286': '286', 'hk863': '863', 'hk937': '937', 'hk1810': '1810', 'hk10': '10', 'hk827': '827', 'hk859': '859', 'hk1596': '1596', 'hk516': '516', 'hk1400': '1400', 'hk391': '391', 'hk1112': '1112', 'hk1807': '1807', 'hk1660': '1660', 'hk1395': '1395', 'hk1856': '1856', 'hk900': '900', 'hk1419': '1419', 'hk979': '979', 'hk185': '185', 'hk322': '322', 'hk1297': '1297', 'hk1918': '1918', 'hk518': '518', 'hk489': '489', 'hk1816': '1816', 'hk1811': '1811', 'hk768': '768', 'hk1729': '1729', 'hk355': '355', 'hk1372': '1372', 'hk1616': '1616', 'hk707': '707', 'hk283': '283', 'hk1130': '1130', 'hk786': '786', 'hk408': '408', 'hk301': '301', 'hk524': '524', 'hk378': '378', 'hk508': '508', 'hk334': '334', 'hk1888': '1888', 'hk1799': '1799', 'hk1788': '1788', 'hk126': '126', 'hk77': '77', 'hk84': '84', 'hk880': '880', 'hk909': '909', 'hk703': '703', 'hk1054': '1054', 'hk1996': '1996', 'hk691': '691', 'hk879': '879', 'hk1877': '1877', 'hk668': '668', 'hk1771': '1771', 'hk1125': '1125', 'hk1941': '1941', 'hk573': '573', 'hk1976': '1976', 'hk460': '460', 'hk142': '142', 'hk1098': '1098', 'hk393': '393', 'hk911': '911', 'hk1182': '1182', 'hk793': '793', 'hk1035': '1035', 'hk1909': '1909', 'hk869': '869', 'hk947': '947', 'hk938': '938', 'hk1730': '1730', 'hk1528': '1528', 'hk1271': '1271', 'hk991': '991', 'hk925': '925', 'hk1593': '1593', 'hk534': '534', 'hk383': '383', 'hk843': '843', 'hk1448': '1448', 'hk254': '254', 'hk741': '741', 'hk1691': '1691', 'hk1339': '1339', 'hk354': '354', 'hk1513': '1513', 'hk520': '520', 'hk1022': '1022', 'hk710': '710', 'hk242': '242', 'hk287': '287', 'hk1224': '1224', 'hk1219': '1219', 'hk1908': '1908', 'hk1368': '1368', 'hk782': '782', 'hk213': '213', 'hk1612': '1612', 'hk476': '476', 'hk1167': '1167', 'hk219': '219', 'hk336': '336', 'hk255': '255', 'hk351': '351', 'hk1969': '1969', 'hk1003': '1003', 'hk1634': '1634', 'hk1420': '1420', 'hk515': '515', 'hk1847': '1847', 'hk1135': '1135', 'hk1585': '1585', 'hk1822': '1822', 'hk1561': '1561', 'hk364': '364', 'hk198': '198', 'hk1496': '1496', 'hk1796': '1796', 'hk1069': '1069', 'hk348': '348', 'hk1173': '1173', 'hk1555': '1555', 'hk929': '929', 'hk1474': '1474', 'hk1688': '1688', 'hk517': '517', 'hk759': '759', 'hk1150': '1150'})
next res : >>> (679, {'hk858': '858', 'hk954': '954', 'hk714': '714', 'hk1075': '1075', 'hk503': '503', 'hk1177': '1177', 'hk1025': '1025', 'hk1097': '1097', 'hk1417': '1417', 'hk1202': '1202', 'hk1508': '1508', 'hk684': '684', 'hk488': '488', 'hk1381': '1381', 'hk723': '723', 'hk104': '104', 'hk1292': '1292', 'hk192': '192', 'hk616': '616', 'hk382': '382', 'hk696': '696', 'hk1945': '1945', 'hk1833': '1833', 'hk1611': '1611', 'hk1735': '1735', 'hk1598': '1598', 'hk1845': '1845', 'hk125': '125', 'hk240': '240', 'hk1000': '1000', 'hk1114': '1114', 'hk1060': '1060', 'hk1739': '1739', 'hk636': '636', 'hk299': '299', 'hk873': '873', 'hk895': '895', 'hk1557': '1557', 'hk1512': '1512', 'hk1356': '1356', 'hk135': '135', 'hk1873': '1873', 'hk1033': '1033', 'hk91': '91', 'hk1790': '1790', 'hk505': '505', 'hk388': '388', 'hk862': '862', 'hk459': '459', 'hk346': '346', 'hk1670': '1670', 'hk984': '984', 'hk556': '556', 'hk1459': '1459', 'hk1443': '1443', 'hk122': '122', 'hk1814': '1814', 'hk1165': '1165', 'hk1797': '1797', 'hk874': '874', 'hk1550': '1550', 'hk1252': '1252', 'hk1064': '1064', 'hk1176': '1176', 'hk1304': '1304', 'hk399': '399', 'hk1019': '1019', 'hk1678': '1678', 'hk1950': '1950', 'hk245': '245', 'hk940': '940', 'hk1388': '1388', 'hk857': '857', 'hk1773': '1773', 'hk1656': '1656', 'hk1072': '1072', 'hk1437': '1437', 'hk33': '33', 'hk390': '390', 'hk1497': '1497', 'hk1266': '1266', 'hk647': '647', 'hk324': '324', 'hk21': '21', 'hk356': '356', 'hk1826': '1826', 'hk681': '681', 'hk1665': '1665', 'hk1476': '1476', 'hk1635': '1635', 'hk1576': '1576', 'hk572': '572', 'hk206': '206', 'hk522': '522', 'hk1905': '1905', 'hk419': '419', 'hk1301': '1301', 'hk867': '867', 'hk539': '539', 'hk613': '613', 'hk285': '285', 'hk1809': '1809', 'hk1859': '1859', 'hk974': '974', 'hk1621': '1621', 'hk496': '496', 'hk284': '284', 'hk845': '845', 'hk1740': '1740', 'hk1926': '1926', 'hk332': '332', 'hk999': '999', 'hk1207': '1207', 'hk1161': '1161', 'hk1746': '1746', 'hk1066': '1066', 'hk1488': '1488', 'hk580': '580', 'hk25': '25', 'hk1206': '1206', 'hk717': '717', 'hk429': '429', 'hk73': '73', 'hk1265': '1265', 'hk883': '883', 'hk1992': '1992', 'hk1478': '1478', 'hk1354': '1354', 'hk1599': '1599', 'hk1362': '1362', 'hk316': '316', 'hk1765': '1765', 'hk1644': '1644', 'hk1220': '1220', 'hk387': '387', 'hk1968': '1968', 'hk1824': '1824', 'hk1626': '1626', 'hk1153': '1153', 'hk1416': '1416', 'hk1934': '1934', 'hk633': '633', 'hk981': '981', 'hk340': '340', 'hk797': '797', 'hk766': '766', 'hk274': '274', 'hk1367': '1367', 'hk558': '558', 'hk37': '37', 'hk817': '817', 'hk309': '309', 'hk1805': '1805', 'hk635': '635', 'hk783': '783', 'hk1042': '1042', 'hk941': '941', 'hk712': '712', 'hk1008': '1008', 'hk1212': '1212', 'hk1587': '1587', 'hk769': '769', 'hk1234': '1234', 'hk1187': '1187', 'hk1231': '1231', 'hk523': '523', 'hk360': '360', 'hk828': '828', 'hk1690': '1690', 'hk1869': '1869', 'hk1861': '1861', 'hk1449': '1449', 'hk331': '331', 'hk1477': '1477', 'hk1429': '1429', 'hk386': '386', 'hk1962': '1962', 'hk39': '39', 'hk1662': '1662', 'hk1534': '1534', 'hk1453': '1453', 'hk182': '182', 'hk623': '623', 'hk1241': '1241', 'hk1823': '1823', 'hk757': '757', 'hk153': '153', 'hk1659': '1659', 'hk1277': '1277', 'hk1971': '1971', 'hk1674': '1674', 'hk1423': '1423', 'hk48': '48', 'hk1399': '1399', 'hk1605': '1605', 'hk392': '392', 'hk414': '414', 'hk448': '448', 'hk809': '809', 'hk1102': '1102', 'hk530': '530', 'hk1189': '1189', 'hk1180': '1180', 'hk1201': '1201', 'hk482': '482', 'hk1559': '1559', 'hk1320': '1320', 'hk567': '567', 'hk152': '152', 'hk1778': '1778', 'hk1345': '1345', 'hk500': '500', 'hk1409': '1409', 'hk1155': '1155', 'hk1836': '1836', 'hk871': '871', 'hk519': '519', 'hk578': '578', 'hk1920': '1920', 'hk1515': '1515', 'hk88': '88', 'hk1795': '1795', 'hk1965': '1965', 'hk40': '40', 'hk1563': '1563', 'hk1545': '1545', 'hk92': '92', 'hk485': '485', 'hk275': '275', 'hk1706': '1706', 'hk1124': '1124', 'hk1575': '1575', 'hk1722': '1722', 'hk1658': '1658', 'hk527': '527', 'hk1350': '1350', 'hk326': '326', 'hk598': '598', 'hk1860': '1860', 'hk919': '919', 'hk1050': '1050', 'hk761': '761', 'hk1482': '1482', 'hk1281': '1281', 'hk982': '982', 'hk824': '824', 'hk1020': '1020', 'hk1249': '1249', 'hk1998': '1998', 'hk1214': '1214', 'hk1458': '1458', 'hk109': '109', 'hk980': '980', 'hk32': '32', 'hk90': '90', 'hk1034': '1034', 'hk375': '375', 'hk1651': '1651', 'hk447': '447', 'hk14': '14', 'hk455': '455', 'hk1884': '1884', 'hk31': '31', 'hk645': '645', 'hk825': '825', 'hk403': '403', 'hk833': '833', 'hk1535': '1535', 'hk1257': '1257', 'hk1439': '1439', 'hk1415': '1415', 'hk1329': '1329', 'hk1978': '1978', 'hk436': '436', 'hk599': '599', 'hk1524': '1524', 'hk1156': '1156', 'hk1562': '1562', 'hk1110': '1110', 'hk1169': '1169', 'hk120': '120', 'hk1785': '1785', 'hk86': '86', 'hk886': '886', 'hk1875': '1875', 'hk502': '502', 'hk179': '179', 'hk19': '19', 'hk27': '27', 'hk374': '374', 'hk83': '83', 'hk528': '528', 'hk474': '474', 'hk1504': '1504', 'hk1594': '1594', 'hk1': '1', 'hk1692': '1692', 'hk506': '506', 'hk1863': '1863', 'hk243': '243', 'hk960': '960'})
next res : >>> (0, {'hk700': '700', 'hk720': '720', 'hk1698': '1698', 'hk342': '342', 'hk60': '60', 'hk1754': '1754', 'hk1030': '1030', 'hk1939': '1939', 'hk1509': '1509', 'hk986': '986', 'hk230': '230', 'hk431': '431', 'hk1903': '1903', 'hk229': '229', 'hk1365': '1365', 'hk1633': '1633', 'hk471': '471', 'hk1507': '1507', 'hk1887': '1887', 'hk28': '28', 'hk1456': '1456', 'hk57': '57', 'hk1923': '1923', 'hk1001': '1001', 'hk1379': '1379', 'hk97': '97', 'hk753': '753', 'hk1501': '1501', 'hk17': '17', 'hk1080': '1080', 'hk1027': '1027', 'hk173': '173', 'hk1637': '1637', 'hk94': '94', 'hk268': '268', 'hk1403': '1403', 'hk1384': '1384', 'hk51': '51', 'hk1018': '1018', 'hk1154': '1154', 'hk1418': '1418', 'hk852': '852', 'hk238': '238', 'hk812': '812', 'hk1752': '1752', 'hk350': '350', 'hk1083': '1083', 'hk464': '464', 'hk276': '276', 'hk203': '203', 'hk1059': '1059', 'hk1243': '1243', 'hk794': '794', 'hk920': '920', 'hk1061': '1061', 'hk1254': '1254', 'hk504': '504', 'hk777': '777', 'hk1727': '1727', 'hk150': '150', 'hk541': '541', 'hk846': '846', 'hk1589': '1589', 'hk680': '680', 'hk330': '330', 'hk22': '22', 'hk180': '180', 'hk889': '889', 'hk449': '449', 'hk760': '760', 'hk1641': '1641', 'hk850': '850', 'hk551': '551', 'hk426': '426', 'hk861': '861', 'hk347': '347', 'hk1116': '1116', 'hk1583': '1583', 'hk319': '319', 'hk536': '536', 'hk1604': '1604', 'hk291': '291', 'hk1334': '1334', 'hk371': '371', 'hk939': '939', 'hk1082': '1082', 'hk950': '950', 'hk95': '95', 'hk1344': '1344', 'hk808': '808', 'hk1216': '1216', 'hk1413': '1413', 'hk674': '674', 'hk170': '170', 'hk26': '26', 'hk602': '602', 'hk595': '595', 'hk479': '479', 'hk1485': '1485', 'hk1211': '1211', 'hk1434': '1434', 'hk1916': '1916', 'hk624': '624', 'hk59': '59', 'hk798': '798', 'hk1273': '1273', 'hk579': '579', 'hk839': '839', 'hk1586': '1586', 'hk1868': '1868', 'hk1744': '1744', 'hk997': '997', 'hk1375': '1375', 'hk1897': '1897', 'hk776': '776', 'hk234': '234', 'hk1070': '1070', 'hk1948': '1948', 'hk545': '545', 'hk487': '487', 'hk1149': '1149', 'hk1675': '1675', 'hk964': '964', 'hk1188': '1188', 'hk1619': '1619', 'hk328': '328', 'hk868': '868', 'hk1386': '1386', 'hk592': '592', 'hk209': '209', 'hk1031': '1031', 'hk1313': '1313', 'hk1625': '1625', 'hk608': '608', 'hk42': '42', 'hk1804': '1804', 'hk1558': '1558', 'hk755': '755', 'hk837': '837', 'hk1782': '1782', 'hk1048': '1048', 'hk187': '187', 'hk1122': '1122', 'hk134': '134', 'hk758': '758', 'hk1529': '1529', 'hk609': '609', 'hk1105': '1105', 'hk927': '927', 'hk661': '661', 'hk1827': '1827', 'hk965': '965', 'hk237': '237', 'hk943': '943', 'hk1336': '1336', 'hk266': '266', 'hk425': '425', 'hk404': '404', 'hk958': '958', 'hk410': '410', 'hk716': '716', 'hk155': '155', 'hk630': '630', 'hk1263': '1263', 'hk1700': '1700', 'hk1510': '1510', 'hk1145': '1145', 'hk1107': '1107', 'hk1717': '1717', 'hk1376': '1376', 'hk1383': '1383', 'hk1159': '1159', 'hk959': '959', 'hk183': '183', 'hk854': '854', 'hk1077': '1077', 'hk1751': '1751', 'hk1426': '1426', 'hk1323': '1323', 'hk550': '550', 'hk677': '677', 'hk1096': '1096', 'hk1564': '1564', 'hk1435': '1435', 'hk690': '690', 'hk903': '903', 'hk934': '934', 'hk1028': '1028', 'hk678': '678', 'hk81': '81', 'hk767': '767', 'hk1073': '1073', 'hk913': '913', 'hk1894': '1894', 'hk389': '389'})
 

相关语法:

hscan key cursor [MATCH pattern] [COUNT count]

SScan 使用

def insert_many_set():
    pipe = redis_cli.pipeline()
    for i in range(2000):
        pipe.sadd("sscan", "s" + str(i))
    pipe.execute()
    print(">>>>>>")


def test_sscan():
    cursor = 0
    match = "s*"
    count = 300
    res = redis_cli.sscan("sscan", cursor, match, count)
    print(res)
    while True:
        if res[0] != 0:
            cursor = res[0]
            res = redis_cli.sscan("sscan", cursor, match, count)
            print(res)
        else:
            break

 以上程序执行结果如下:

(868, ['s1722', 's1528', 's96', 's220', 's1421', 's144', 's879', 's1754', 's375', 's1477', 's1251', 's1265', 's1124', 's243', 's648', 's1802', 's747', 's1302', 's1272', 's1749', 's121', 's55', 's1150', 's844', 's647', 's1465', 's1413', 's458', 's445', 's1103', 's391', 's1206', 's1063', 's1408', 's620', 's1180', 's1921', 's291', 's713', 's175', 's177', 's793', 's1606', 's1496', 's1598', 's1165', 's1404', 's1643', 's132', 's359', 's685', 's846', 's518', 's918', 's1805', 's744', 's586', 's108', 's923', 's609', 's978', 's718', 's429', 's1153', 's1045', 's1460', 's320', 's1987', 's1820', 's342', 's145', 's852', 's312', 's34', 's262', 's98', 's1944', 's125', 's1160', 's837', 's1038', 's1894', 's1553', 's347', 's302', 's123', 's876', 's1737', 's224', 's1307', 's792', 's1720', 's1051', 's1573', 's236', 's369', 's1531', 's1448', 's1247', 's652', 's1501', 's847', 's1356', 's1331', 's1255', 's1602', 's349', 's1980', 's486', 's1470', 's1498', 's489', 's1582', 's1052', 's1864', 's1035', 's675', 's1586', 's289', 's1920', 's1853', 's558', 's1278', 's148', 's1716', 's173', 's1183', 's293', 's802', 's199', 's1121', 's561', 's35', 's329', 's1534', 's1339', 's912', 's1851', 's1332', 's81', 's1928', 's618', 's830', 's463', 's413', 's1684', 's1043', 's1324', 's1113', 's1811', 's1708', 's592', 's1792', 's1112', 's1603', 's523', 's853', 's207', 's139', 's867', 's1172', 's1167', 's947', 's1227', 's1705', 's85', 's222', 's130', 's932', 's734', 's1664', 's1965', 's1545', 's1509', 's880', 's1464', 's61', 's964', 's1438', 's584', 's1309', 's1065', 's356', 's195', 's1274', 's394', 's1925', 's1690', 's1922', 's633', 's787', 's423', 's226', 's1562', 's1362', 's143', 's422', 's1631', 's382', 's665', 's1236', 's669', 's934', 's1391', 's1904', 's822', 's1066', 's927', 's1109', 's1044', 's1298', 's1276', 's813', 's1211', 's440', 's819', 's1949', 's363', 's1087', 's1137', 's621', 's728', 's1613', 's1034', 's1548', 's398', 's858', 's104', 's1230', 's1625', 's762', 's500', 's779', 's1403', 's1955', 's761', 's1134', 's194', 's720', 's424', 's24', 's914', 's1040', 's389', 's1530', 's1164', 's1002', 's1628', 's1326', 's1577', 's1367', 's414', 's1692', 's1418', 's456', 's798', 's915', 's1758', 's190', 's829', 's937', 's1210', 's595', 's227', 's862', 's1486', 's758', 's724', 's1270', 's716', 's95', 's566', 's384', 's1392', 's514', 's316', 's1905', 's162', 's1835', 's1981', 's1581', 's985', 's1695', 's1622', 's1212', 's1175', 's1168', 's1395', 's1449', 's1102', 's1996', 's1826', 's738', 's1246', 's201', 's905', 's1293', 's723', 's730', 's1176'])
(754, ['s215', 's833', 's972', 's1091', 's1056', 's225', 's416', 's1360', 's1560', 's522', 's1279', 's1838', 's1511', 's617', 's205', 's681', 's745', 's1363', 's118', 's281', 's1571', 's1157', 's376', 's1088', 's1913', 's1819', 's908', 's1763', 's1827', 's1436', 's1680', 's367', 's67', 's1468', 's605', 's265', 's1118', 's697', 's1104', 's982', 's1285', 's436', 's743', 's866', 's482', 's1389', 's1377', 's569', 's1994', 's1719', 's397', 's305', 's1131', 's1756', 's1308', 's1729', 's1373', 's506', 's1116', 's1559', 's155', 's1188', 's1879', 's1814', 's580', 's1033', 's1393', 's1189', 's1794', 's415', 's804', 's1923', 's807', 's1299', 's1197', 's1727', 's1217', 's70', 's271', 's1225', 's1281', 's1768', 's1773', 's1595', 's1796', 's1938', 's417', 's603', 's1740', 's854', 's141', 's1666', 's527', 's53', 's1874', 's1525', 's684', 's117', 's1732', 's184', 's1983', 's1909', 's466', 's1764', 's741', 's877', 's1120', 's581', 's1', 's1660', 's443', 's989', 's1359', 's732', 's1765', 's1867', 's259', 's1977', 's800', 's1651', 's1538', 's1816', 's250', 's82', 's622', 's662', 's1090', 's1840', 's1050', 's1986', 's759', 's1098', 's1074', 's1698', 's691', 's1234', 's1943', 's310', 's179', 's68', 's392', 's589', 's1481', 's326', 's1642', 's1691', 's1590', 's986', 's1963', 's90', 's164', 's774', 's1435', 's960', 's1342', 's1715', 's574', 's277', 's1017', 's1578', 's638', 's1414', 's1203', 's1178', 's1406', 's1306', 's760', 's1991', 's322', 's658', 's48', 's888', 's1797', 's840', 's1881', 's1830', 's980', 's1415', 's112', 's1611', 's568', 's538', 's1349', 's484', 's444', 's1718', 's474', 's454', 's849', 's1539', 's1714', 's511', 's1071', 's1937', 's373', 's42', 's213', 's1743', 's1524', 's1358', 's446', 's1932', 's1747', 's1262', 's1214', 's1858', 's1401', 's178', 's857', 's1899', 's285', 's704', 's508', 's1282', 's28', 's859', 's1654', 's1667', 's889', 's1258', 's1093', 's515', 's1437', 's1242', 's146', 's99', 's19', 's1283', 's661', 's1575', 's280', 's94', 's534', 's23', 's993', 's1248', 's202', 's765', 's1844', 's366', 's1751', 's1912', 's1857', 's1494', 's887', 's208', 's1761', 's1589', 's1077', 's298', 's893', 's1338', 's439', 's211', 's1544', 's1054', 's1241', 's746', 's1934', 's1600', 's1001', 's159', 's1665', 's192', 's878', 's1447', 's318', 's128', 's283', 's1364', 's645', 's43', 's50', 's172', 's1205', 's1318', 's420', 's991', 's674', 's334', 's360', 's1031', 's1624', 's1990', 's156', 's936', 's1785', 's1646', 's610', 's1653', 's1427', 's789', 's820', 's950', 's1459', 's1419', 's168', 's1219', 's814', 's710'])
(1614, ['s191', 's1957', 's1119', 's1821', 's1951', 's1140', 's1518', 's1352', 's233', 's1984', 's1549', 's607', 's396', 's10', 's722', 's1444', 's1154', 's874', 's1546', 's1410', 's841', 's468', 's922', 's979', 's287', 's629', 's1960', 's1945', 's1325', 's1008', 's274', 's1917', 's1291', 's892', 's242', 's835', 's1550', 's1365', 's1042', 's1672', 's651', 's75', 's1861', 's1319', 's1612', 's1194', 's1588', 's1125', 's1463', 's1831', 's883', 's1568', 's1902', 's966', 's1522', 's1027', 's1144', 's512', 's377', 's593', 's1617', 's1824', 's766', 's435', 's1998', 's368', 's1480', 's1080', 's307', 's1079', 's380', 's370', 's212', 's810', 's598', 's907', 's1580', 's425', 's1677', 's395', 's86', 's268', 's1239', 's532', 's430', 's62', 's1866', 's1788', 's702', 's238', 's45', 's255', 's1868', 's1366', 's756', 's1062', 's49', 's712', 's1854', 's160', 's209', 's977', 's1884', 's1301', 's336', 's1637', 's1769', 's956', 's954', 's261', 's1759', 's1492', 's133', 's182', 's113', 's845', 's1676', 's812', 's140', 's698', 's1006', 's895', 's465', 's147', 's491', 's1379', 's1532', 's524', 's601', 's127', 's371', 's1170', 's521', 's517', 's788', 's900', 's784', 's1730', 's944', 's1843', 's560', 's1552', 's237', 's1493', 's602', 's1870', 's462', 's441', 's300', 's1058', 's1195', 's1368', 's757', 's448', 's1072', 's241', 's639', 's796', 's206', 's59', 's623', 's449', 's778', 's1779', 's325', 's1663', 's670', 's248', 's1009', 's1094', 's1171', 's1939', 's232', 's1505', 's727', 's87', 's1004', 's783', 's158', 's640', 's1396', 's186', 's1269', 's642', 's1799', 's643', 's385', 's931', 's672', 's1474', 's1095', 's1704', 's69', 's301', 's1513', 's1387', 's1317', 's1806', 's1108', 's1423', 's536', 's92', 's1303', 's1753', 's150', 's1133', 's1828', 's354', 's1766', 's948', 's1872', 's769', 's1812', 's1739', 's869', 's1287', 's848', 's204', 's537', 's1030', 's646', 's614', 's1304', 's80', 's1127', 's1110', 's708', 's1762', 's749', 's12', 's507', 's943', 's1686', 's1699', 's736', 's219', 's1908', 's754', 's763', 's1316', 's292', 's1810', 's72', 's872', 's1032', 's1487', 's773', 's1489', 's547', 's1169', 's1527', 's79', 's260', 's868', 's102', 's894', 's725', 's88', 's311', 's1526', 's1668', 's1659', 's873', 's542', 's453', 's1105', 's1478', 's464', 's170', 's1662', 's1416', 's951', 's1148', 's548', 's611', 's431', 's188', 's1155', 's1615', 's881', 's278', 's1869', 's1400', 's552', 's1793', 's1003', 's1305', 's1638', 's983', 's579', 's1322', 's1314', 's1597', 's834', 's785', 's1971', 's1635', 's1275', 's1890', 's1245'])
(1129, ['s1558', 's903', 's719', 's938', 's1442', 's1621', 's457', 's1536', 's1073', 's1649', 's1880', 's1384', 's22', 's1126', 's679', 's865', 's1433', 's677', 's1903', 's1950', 's1565', 's1443', 's308', 's613', 's163', 's114', 's63', 's181', 's1863', 's124', 's1726', 's540', 's1551', 's1143', 's341', 's1734', 's1429', 's38', 's1741', 's1370', 's539', 's379', 's33', 's279', 's1782', 's1020', 's1096', 's1139', 's1976', 's1696', 's886', 's1630', 's1512', 's151', 's459', 's861', 's1941', 's1804', 's1618', 's1888', 's1808', 's501', 's231', 's551', 's961', 's1085', 's1885', 's1557', 's1424', 's51', 's76', 's1614', 's1608', 's1268', 's496', 's480', 's73', 's203', 's1644', 's929', 's805', 's1182', 's920', 's467', 's729', 's1787', 's1129', 's1371', 's1790', 's1681', 's690', 's1605', 's452', 's1731', 's71', 's1488', 's1398', 's223', 's564', 's1343', 's1982', 's497', 's29', 's1795', 's1674', 's1330', 's1807', 's864', 's1399', 's1809', 's1817', 's1502', 's1678', 's1706', 's109', 's39', 's1607', 's374', 's21', 's1506', 's1682', 's387', 's119', 's554', 's925', 's44', 's913', 's1454', 's1280', 's1198', 's1556', 's1953', 's627', 's1781', 's531', 's129', 's235', 's297', 's1850', 's1543', 's680', 's587', 's687', 's1337', 's751', 's229', 's1645', 's656', 's1542', 's1417', 's1620', 's825', 's588', 's1290', 's1284', 's1046', 's1724', 's896', 's433', 's1770', 's1297', 's1892', 's1632', 's406', 's294', 's1407', 's526', 's550', 's1082', 's992', 's333', 's1671', 's335', 's970', 's976', 's699', 's32', 's493', 's142', 's323', 's1256', 's1025', 's1439', 's1849', 's252', 's671', 's811', 's737', 's1022', 's1130', 's1658', 's101', 's14', 's1915', 's1889', 's606', 's999', 's1882', 's525', 's628', 's663', 's1871', 's197', 's183', 's1520', 's1483', 's1490', 's1569', 's338', 's3', 's343', 's1193', 's1159', 's1382', 's755', 's1725', 's1801', 's438', 's110', 's1238', 's625', 's115', 's1161', 's1346', 's1873', 's726', 's969', 's909', 's1333', 's40', 's945', 's775', 's965', 's1411', 's1220', 's138', 's616', 's1067', 's365', 's1774', 's193', 's1815', 's1422', 's1341', 's1780', 's83', 's245', 's1841', 's1893', 's313', 's1163', 's1441', 's1563', 's1037', 's1576', 's1078', 's1516', 's1456', 's949', 's1572', 's995', 's1822', 's801', 's1375', 's612', 's1233', 's1007', 's1345', 's357', 's103', 's1135', 's1259', 's1641', 's917', 's1655', 's1426', 's107', 's275', 's78', 's1237', 's1533', 's1186', 's1458', 's1378', 's1114', 's499', 's957', 's239', 's15', 's683', 's337', 's1652', 's815', 's1742', 's1985', 's1190', 's399', 's1271', 's157', 's47', 's1083'])
(573, ['s1213', 's1267', 's1954', 's1015', 's1402', 's60', 's1425', 's1173', 's1623', 's504', 's1097', 's1907', 's851', 's100', 's1394', 's1431', 's1564', 's476', 's1434', 's1412', 's1244', 's1149', 's149', 's1771', 's1933', 's882', 's1123', 's1048', 's122', 's8', 's513', 's2', 's563', 's655', 's1519', 's1218', 's575', 's1911', 's74', 's1689', 's928', 's577', 's885', 's1340', 's870', 's487', 's1472', 's701', 's1919', 's1744', 's1529', 's1145', 's1059', 's1462', 's1583', 's1224', 's1961', 's244', 's803', 's1336', 's314', 's1010', 's1277', 's1570', 's1499', 's324', 's650', 's786', 's549', 's404', 's36', 's1132', 's490', 's1656', 's653', 's428', 's503', 's1471', 's1974', 's246', 's1709', 's1537', 's689', 's483', 's383', 's152', 's1710', 's1497', 's1089', 's1521', 's364', 's189', 's1738', 's1466', 's93', 's330', 's545', 's418', 's827', 's1243', 's1473', 's1199', 's1916', 's1845', 's401', 's1877', 's791', 's715', 's1931', 's1202', 's286', 's249', 's817', 's1541', 's1128', 's1859', 's30', 's442', 's437', 's1111', 's1777', 's1752', 's808', 's1946', 's1789', 's1675', 's637', 's739', 's703', 's794', 's426', 's1973', 's1735', 's361', 's295', 's555', 's84', 's1897', 's1697', 's1397', 's897', 's1591', 's832', 's856', 's988', 's714', 's1294', 's1952', 's495', 's258', 's1235', 's530', 's25', 's1685', 's218', 's56', 's693', 's1495', 's1829', 's1555', 's984', 's1226', 's987', 's700', 's1775', 's1334', 's996', 's659', 's1584', 's1047', 's196', 's386', 's1936', 's1013', 's1910', 's1523', 's200', 's1848', 's974', 's1260', 's1535', 's1012', 's1929', 's230', 's831', 's494', 's1289', 's479', 's116', 's1162', 's171', 's340', 's818', 's1208', 's1596', 's1504', 's176', 's1604', 's1640', 's875', 's1185', 's1855', 's955', 's1856', 's1475', 's1036', 's630', 's619', 's1721', 's388', 's1778', 's1353', 's257', 's600', 's1964', 's926', 's1683', 's1381', 's1209', 's520', 's942', 's1023', 's1846', 's664', 's1760', 's1264', 's106', 's1587', 's1106', 's1669', 's1484', 's473', 's591', 's733', 's1503', 's1117', 's1450', 's1380', 's748', 's1918', 's1152', 's1999', 's1997', 's198', 's309', 's187', 's1995', 's1069', 's1310', 's583', 's921', 's1619', 's97', 's65', 's1057', 's556', 's264', 's1200', 's303', 's1825', 's1650', 's695', 's1158', 's154', 's1818', 's884', 's772', 's1156', 's959', 's451', 's968', 's276', 's344', 's860', 's1409', 's1707', 's263', 's137', 's253', 's1221', 's678', 's850', 's1191', 's1016', 's1970', 's1428', 's393', 's933', 's953', 's939', 's1592', 's1687', 's1461', 's353', 's1440', 's780', 's692', 's1914', 's1386', 's165'])
(103, ['s1594', 's505', 's1204', 's1813', 's1803', 's1174', 's823', 's1021', 's328', 's1014', 's1712', 's317', 's1593', 's461', 's214', 's1975', 's299', 's272', 's826', 's1329', 's91', 's1862', 's304', 's911', 's1755', 's13', 's288', 's331', 's795', 's821', 's768', 's1018', 's1798', 's321', 's1883', 's1647', 's657', 's1348', 's1599', 's836', 's1430', 's270', 's635', 's1517', 's1101', 's185', 's1187', 's644', 's161', 's1906', 's1948', 's946', 's1420', 's1257', 's1701', 's1457', 's1958', 's777', 's1791', 's135', 's1574', 's1151', 's1657', 's816', 's1029', 's1993', 's16', 's599', 's1926', 's1060', 's296', 's1354', 's585', 's273', 's1507', 's9', 's1800', 's935', 's434', 's971', 's478', 's1136', 's358', 's1390', 's1900', 's582', 's952', 's1639', 's1446', 's597', 's1783', 's1776', 's721', 's562', 's1510', 's1713', 's1385', 's1968', 's1648', 's1138', 's327', 's1240', 's11', 's1561', 's284', 's902', 's408', 's649', 's1736', 's1361', 's604', 's1099', 's1076', 's1887', 's1479', 's1231', 's1886', 's269', 's1972', 's1895', 's1733', 's1547', 's1335', 's1875', 's351', 's688', 's1988', 's4', 's1055', 's824', 's930', 's1064', 's898', 's1688', 's1024', 's240', 's1966', 's1372', 's1967', 's1891', 's1351', 's510', 's567', 's167', 's1273', 's572', 's1223', 's471', 's5', 's904', 's120', 's998', 's315', 's1383', 's764', 's1028', 's1847', 's1839', 's1328', 's1312', 's1295', 's492', 's1767', 's828', 's54', 's696', 's641', 's7', 's636', 's1313', 's1694', 's901', 's421', 's352', 's1962', 's1978', 's390', 's711', 's1141', 's378', 's973', 's403', 's781', 's1107', 's1500', 's485', 's481', 's472', 's460', 's26', 's1927', 's654', 's590', 's553', 's1388', 's254', 's1703', 's839', 's455', 's890', 's1700', 's1061', 's838', 's544', 's1019', 's1092', 's682', 's855', 's1585', 's46', 's975', 's906', 's1053', 's105', 's350', 's1452', 's753', 's1005', 's694', 's1455', 's1355', 's1992', 's1940', 's470', 's412', 's1261', 's169', 's1748', 's1070', 's6', 's632', 's1222', 's1292', 's1832', 's666', 's450', 's750', 's475', 's1146', 's1823', 's941', 's565', 's990', 's1746', 's348', 's1300', 's1215', 's1196', 's576', 's52', 's37', 's332', 's1166', 's1476', 's1253', 's1627', 's981', 's402', 's740', 's533', 's1485', 's799', 's1321', 's1673', 's234', 's1039', 's529', 's994', 's319', 's1142', 's1842', 's27', 's863', 's1347', 's1670', 's136', 's1068', 's731', 's1947', 's1286', 's940', 's1232', 's1041', 's809', 's843', 's1878', 's372', 's626', 's228', 's1634', 's1772', 's1601', 's77', 's962', 's1540', 's477', 's447', 's1717', 's1081', 's1344'])
(0, ['s1935', 's1728', 's899', 's631', 's498', 's400', 's676', 's1376', 's1192', 's782', 's1249', 's752', 's1100', 's1786', 's1702', 's1633', 's1207', 's1445', 's1491', 's66', 's1515', 's174', 's180', 's432', 's790', 's806', 's1320', 's1930', 's1626', 's1451', 's1026', 's1609', 's997', 's1000', 's1405', 's1327', 's20', 's1610', 's516', 's111', 's705', 's1084', 's891', 's1836', 's541', 's18', 's282', 's770', 's570', 's1784', 's58', 's1201', 's559', 's411', 's660', 's1554', 's266', 's1924', 's767', 's345', 's1453', 's1833', 's634', 's1469', 's543', 's1750', 's1374', 's1315', 's776', 's1723', 's557', 's1757', 's1357', 's1288', 's1567', 's1896', 's1629', 's410', 's1482', 's1266', 's89', 's469', 's1369', 's1679', 's771', 's1250', 's1350', 's519', 's596', 's707', 's488', 's1049', 's210', 's1075', 's916', 's578', 's1566', 's381', 's1229', 's131', 's967', 's535', 's1311', 's126', 's1115', 's673', 's1228', 's1432', 's1216', 's1508', 's1323', 's502', 's362', 's1177', 's1979', 's1147', 's221', 's1969', 's1181', 's247', 's608', 's17', 's355', 's1263', 's1693', 's706', 's842', 's1086', 's166', 's407', 's251', 's1254', 's256', 's217', 's1661', 's686', 's1467', 's1860', 's742', 's667', 's346', 's134', 's1636', 's31', 's1011', 's797', 's339', 's1514', 's624', 's419', 's1184', 's1942', 's41', 's57', 's427', 's910', 's1834', 's1616', 's1837', 's153', 's216', 's267', 's1876', 's290', 's509', 's409', 's1901', 's546', 's528', 's735', 's963', 's571', 's1852', 's306', 's958', 's1956', 's1865', 's573', 's405', 's1122', 's1579', 's615', 's709', 's1179', 's1711', 's668', 's871', 's1959', 's1989', 's1296', 's924', 's1898', 's1252', 's1745', 's594', 's919', 's717', 's64', 's0']) 

相关语法:

sscan key cursor [MATCH pattern] [COUNT count]

 ZScan 使用

def insert_many_zset():
    pipe = redis_cli.pipeline()
    for i in range(2000):
        pipe.zadd("zscan", {"z" + str(i): i})
    pipe.execute()
    print(">>>>>success")


def test_zscan():
    cursor = 0
    match = "z*"
    count = 300
    res = redis_cli.zscan("zscan", cursor, match, count)
    print("????", res)
    while True:
        if res[0] != 0:
            cursor = res[0]
            res = redis_cli.zscan("zscan", cursor, match, count)
            print("<>>>>>>>>>>>", res)
        else:
            break

以上程序执行结果如下:

???? (164, [('z1131', 1131.0), ('z456', 456.0), ('z791', 791.0), ('z88', 88.0), ('z529', 529.0), ('z434', 434.0), ('z1744', 1744.0), ('z1983', 1983.0), ('z609', 609.0), ('z492', 492.0), ('z565', 565.0), ('z1450', 1450.0), ('z113', 113.0), ('z655', 655.0), ('z449', 449.0), ('z66', 66.0), ('z795', 795.0), ('z1654', 1654.0), ('z1579', 1579.0), ('z506', 506.0), ('z446', 446.0), ('z387', 387.0), ('z1932', 1932.0), ('z1507', 1507.0), ('z489', 489.0), ('z687', 687.0), ('z15', 15.0), ('z959', 959.0), ('z849', 849.0), ('z1133', 1133.0), ('z1368', 1368.0), ('z327', 327.0), ('z452', 452.0), ('z98', 98.0), ('z1655', 1655.0), ('z507', 507.0), ('z1132', 1132.0), ('z391', 391.0), ('z22', 22.0), ('z1602', 1602.0), ('z1545', 1545.0), ('z897', 897.0), ('z926', 926.0), ('z1086', 1086.0), ('z420', 420.0), ('z1566', 1566.0), ('z976', 976.0), ('z64', 64.0), ('z1901', 1901.0), ('z299', 299.0), ('z1278', 1278.0), ('z149', 149.0), ('z1910', 1910.0), ('z1814', 1814.0), ('z1721', 1721.0), ('z1670', 1670.0), ('z131', 131.0), ('z1626', 1626.0), ('z439', 439.0), ('z877', 877.0), ('z945', 945.0), ('z1308', 1308.0), ('z1129', 1129.0), ('z696', 696.0), ('z1495', 1495.0), ('z206', 206.0), ('z899', 899.0), ('z76', 76.0), ('z160', 160.0), ('z1393', 1393.0), ('z338', 338.0), ('z1433', 1433.0), ('z503', 503.0), ('z880', 880.0), ('z1353', 1353.0), ('z269', 269.0), ('z166', 166.0), ('z1769', 1769.0), ('z435', 435.0), ('z961', 961.0), ('z1962', 1962.0), ('z1088', 1088.0), ('z1122', 1122.0), ('z956', 956.0), ('z1637', 1637.0), ('z478', 478.0), ('z1982', 1982.0), ('z1584', 1584.0), ('z668', 668.0), ('z1105', 1105.0), ('z1906', 1906.0), ('z941', 941.0), ('z421', 421.0), ('z1247', 1247.0), ('z1191', 1191.0), ('z152', 152.0), ('z1895', 1895.0), ('z978', 978.0), ('z225', 225.0), ('z571', 571.0), ('z1706', 1706.0), ('z1547', 1547.0), ('z783', 783.0), ('z90', 90.0), ('z1934', 1934.0), ('z53', 53.0), ('z1773', 1773.0), ('z385', 385.0), ('z1996', 1996.0), ('z351', 351.0), ('z841', 841.0), ('z1849', 1849.0), ('z1917', 1917.0), ('z1089', 1089.0), ('z1669', 1669.0), ('z1274', 1274.0), ('z705', 705.0), ('z1022', 1022.0), ('z1172', 1172.0), ('z592', 592.0), ('z685', 685.0), ('z623', 623.0), ('z1397', 1397.0), ('z70', 70.0), ('z1787', 1787.0), ('z1219', 1219.0), ('z397', 397.0), ('z293', 293.0), ('z1640', 1640.0), ('z1550', 1550.0), ('z83', 83.0), ('z438', 438.0), ('z933', 933.0), ('z1943', 1943.0), ('z283', 283.0), ('z82', 82.0), ('z1526', 1526.0), ('z1825', 1825.0), ('z1310', 1310.0), ('z1421', 1421.0), ('z416', 416.0), ('z154', 154.0), ('z165', 165.0), ('z786', 786.0), ('z1734', 1734.0), ('z543', 543.0), ('z437', 437.0), ('z330', 330.0), ('z604', 604.0), ('z1619', 1619.0), ('z229', 229.0), ('z1683', 1683.0), ('z1419', 1419.0), ('z1991', 1991.0), ('z804', 804.0), ('z1643', 1643.0), ('z638', 638.0), ('z1874', 1874.0), ('z846', 846.0), ('z1220', 1220.0), ('z254', 254.0), ('z232', 232.0), ('z1081', 1081.0), ('z1485', 1485.0), ('z1347', 1347.0), ('z781', 781.0), ('z1775', 1775.0), ('z1800', 1800.0), ('z450', 450.0), ('z411', 411.0), ('z1511', 1511.0), ('z1151', 1151.0), ('z1623', 1623.0), ('z1427', 1427.0), ('z979', 979.0), ('z20', 20.0), ('z512', 512.0), ('z1830', 1830.0), ('z361', 361.0), ('z1229', 1229.0), ('z29', 29.0), ('z1967', 1967.0), ('z1477', 1477.0), ('z887', 887.0), ('z1714', 1714.0), ('z1585', 1585.0), ('z376', 376.0), ('z1113', 1113.0), ('z1857', 1857.0), ('z1459', 1459.0), ('z1055', 1055.0), ('z744', 744.0), ('z381', 381.0), ('z594', 594.0), ('z341', 341.0), ('z542', 542.0), ('z1742', 1742.0), ('z277', 277.0), ('z1896', 1896.0), ('z451', 451.0), ('z264', 264.0), ('z1990', 1990.0), ('z1839', 1839.0), ('z1494', 1494.0), ('z1713', 1713.0), ('z1705', 1705.0), ('z354', 354.0), ('z1600', 1600.0), ('z1496', 1496.0), ('z1513', 1513.0), ('z1209', 1209.0), ('z1316', 1316.0), ('z1259', 1259.0), ('z499', 499.0), ('z1061', 1061.0), ('z1149', 1149.0), ('z458', 458.0), ('z1093', 1093.0), ('z1354', 1354.0), ('z1321', 1321.0), ('z289', 289.0), ('z1609', 1609.0), ('z888', 888.0), ('z235', 235.0), ('z1082', 1082.0), ('z179', 179.0), ('z796', 796.0), ('z1660', 1660.0), ('z739', 739.0), ('z1442', 1442.0), ('z1688', 1688.0), ('z1810', 1810.0), ('z751', 751.0), ('z108', 108.0), ('z1404', 1404.0), ('z1108', 1108.0), ('z1394', 1394.0), ('z763', 763.0), ('z1621', 1621.0), ('z838', 838.0), ('z1177', 1177.0), ('z157', 157.0), ('z1594', 1594.0), ('z566', 566.0), ('z1097', 1097.0), ('z649', 649.0), ('z1725', 1725.0), ('z168', 168.0), ('z280', 280.0), ('z278', 278.0), ('z495', 495.0), ('z1383', 1383.0), ('z680', 680.0), ('z960', 960.0), ('z377', 377.0), ('z2', 2.0), ('z1456', 1456.0), ('z497', 497.0), ('z317', 317.0), ('z429', 429.0), ('z663', 663.0), ('z605', 605.0), ('z1963', 1963.0), ('z77', 77.0), ('z1907', 1907.0), ('z1856', 1856.0), ('z665', 665.0), ('z494', 494.0), ('z192', 192.0), ('z975', 975.0), ('z1746', 1746.0), ('z1750', 1750.0), ('z1350', 1350.0), ('z1343', 1343.0), ('z1037', 1037.0), ('z1323', 1323.0), ('z1752', 1752.0), ('z222', 222.0), ('z199', 199.0), ('z1285', 1285.0), ('z870', 870.0), ('z312', 312.0), ('z8', 8.0), ('z1202', 1202.0), ('z1816', 1816.0), ('z1738', 1738.0), ('z1425', 1425.0), ('z616', 616.0), ('z963', 963.0), ('z1876', 1876.0), ('z1455', 1455.0), ('z624', 624.0), ('z771', 771.0), ('z657', 657.0), ('z1862', 1862.0), ('z1287', 1287.0), ('z557', 557.0), ('z502', 502.0), ('z1119', 1119.0), ('z513', 513.0), ('z23', 23.0), ('z674', 674.0)])
<>>>>>>>>>>> (1458, [('z86', 86.0), ('z1728', 1728.0), ('z728', 728.0), ('z1360', 1360.0), ('z1329', 1329.0), ('z878', 878.0), ('z101', 101.0), ('z345', 345.0), ('z1117', 1117.0), ('z348', 348.0), ('z812', 812.0), ('z581', 581.0), ('z1598', 1598.0), ('z599', 599.0), ('z1214', 1214.0), ('z1018', 1018.0), ('z1144', 1144.0), ('z1470', 1470.0), ('z1241', 1241.0), ('z634', 634.0), ('z367', 367.0), ('z273', 273.0), ('z927', 927.0), ('z1696', 1696.0), ('z218', 218.0), ('z1964', 1964.0), ('z383', 383.0), ('z955', 955.0), ('z964', 964.0), ('z1630', 1630.0), ('z1417', 1417.0), ('z67', 67.0), ('z1461', 1461.0), ('z129', 129.0), ('z246', 246.0), ('z682', 682.0), ('z1311', 1311.0), ('z369', 369.0), ('z1231', 1231.0), ('z1919', 1919.0), ('z1759', 1759.0), ('z1674', 1674.0), ('z285', 285.0), ('z1019', 1019.0), ('z1068', 1068.0), ('z622', 622.0), ('z1981', 1981.0), ('z1183', 1183.0), ('z1847', 1847.0), ('z363', 363.0), ('z817', 817.0), ('z694', 694.0), ('z1715', 1715.0), ('z1292', 1292.0), ('z405', 405.0), ('z1894', 1894.0), ('z695', 695.0), ('z339', 339.0), ('z1520', 1520.0), ('z407', 407.0), ('z808', 808.0), ('z1762', 1762.0), ('z1004', 1004.0), ('z1840', 1840.0), ('z1562', 1562.0), ('z406', 406.0), ('z583', 583.0), ('z1192', 1192.0), ('z310', 310.0), ('z244', 244.0), ('z1555', 1555.0), ('z520', 520.0), ('z320', 320.0), ('z1809', 1809.0), ('z521', 521.0), ('z1338', 1338.0), ('z212', 212.0), ('z531', 531.0), ('z593', 593.0), ('z1703', 1703.0), ('z676', 676.0), ('z1719', 1719.0), ('z1942', 1942.0), ('z1604', 1604.0), ('z1400', 1400.0), ('z554', 554.0), ('z916', 916.0), ('z664', 664.0), ('z988', 988.0), ('z1007', 1007.0), ('z1833', 1833.0), ('z1865', 1865.0), ('z1521', 1521.0), ('z738', 738.0), ('z1318', 1318.0), ('z944', 944.0), ('z473', 473.0), ('z1935', 1935.0), ('z1927', 1927.0), ('z1049', 1049.0), ('z768', 768.0), ('z745', 745.0), ('z873', 873.0), ('z1657', 1657.0), ('z347', 347.0), ('z87', 87.0), ('z1774', 1774.0), ('z1465', 1465.0), ('z1159', 1159.0), ('z1008', 1008.0), ('z1330', 1330.0), ('z390', 390.0), ('z117', 117.0), ('z750', 750.0), ('z1444', 1444.0), ('z440', 440.0), ('z468', 468.0), ('z118', 118.0), ('z574', 574.0), ('z1552', 1552.0), ('z891', 891.0), ('z1261', 1261.0), ('z844', 844.0), ('z1044', 1044.0), ('z340', 340.0), ('z1352', 1352.0), ('z677', 677.0), ('z552', 552.0), ('z799', 799.0), ('z1063', 1063.0), ('z1666', 1666.0), ('z380', 380.0), ('z1264', 1264.0), ('z1293', 1293.0), ('z890', 890.0), ('z1269', 1269.0), ('z92', 92.0), ('z1965', 1965.0), ('z215', 215.0), ('z1011', 1011.0), ('z1992', 1992.0), ('z1854', 1854.0), ('z459', 459.0), ('z713', 713.0), ('z142', 142.0), ('z257', 257.0), ('z326', 326.0), ('z717', 717.0), ('z1104', 1104.0), ('z1586', 1586.0), ('z1884', 1884.0), ('z1344', 1344.0), ('z764', 764.0), ('z516', 516.0), ('z297', 297.0), ('z1685', 1685.0), ('z1124', 1124.0), ('z1892', 1892.0), ('z1557', 1557.0), ('z724', 724.0), ('z21', 21.0), ('z721', 721.0), ('z402', 402.0), ('z585', 585.0), ('z848', 848.0), ('z1702', 1702.0), ('z1641', 1641.0), ('z1537', 1537.0), ('z1536', 1536.0), ('z522', 522.0), ('z612', 612.0), ('z1157', 1157.0), ('z1100', 1100.0), ('z1056', 1056.0), ('z1472', 1472.0), ('z686', 686.0), ('z673', 673.0), ('z589', 589.0), ('z606', 606.0), ('z1838', 1838.0), ('z1889', 1889.0), ('z863', 863.0), ('z1926', 1926.0), ('z1052', 1052.0), ('z1913', 1913.0), ('z41', 41.0), ('z1558', 1558.0), ('z1798', 1798.0), ('z1471', 1471.0), ('z318', 318.0), ('z290', 290.0), ('z546', 546.0), ('z577', 577.0), ('z1649', 1649.0), ('z1371', 1371.0), ('z1777', 1777.0), ('z1530', 1530.0), ('z793', 793.0), ('z80', 80.0), ('z169', 169.0), ('z231', 231.0), ('z898', 898.0), ('z1633', 1633.0), ('z862', 862.0), ('z1605', 1605.0), ('z1589', 1589.0), ('z1546', 1546.0), ('z140', 140.0), ('z261', 261.0), ('z708', 708.0), ('z773', 773.0), ('z1888', 1888.0), ('z1749', 1749.0), ('z1648', 1648.0), ('z128', 128.0), ('z1257', 1257.0), ('z986', 986.0), ('z1835', 1835.0), ('z1818', 1818.0), ('z185', 185.0), ('z180', 180.0), ('z1955', 1955.0), ('z1020', 1020.0), ('z923', 923.0), ('z591', 591.0), ('z639', 639.0), ('z99', 99.0), ('z704', 704.0), ('z596', 596.0), ('z1412', 1412.0), ('z1796', 1796.0), ('z1453', 1453.0), ('z934', 934.0), ('z1803', 1803.0), ('z538', 538.0), ('z228', 228.0), ('z831', 831.0), ('z943', 943.0), ('z969', 969.0), ('z1611', 1611.0), ('z951', 951.0), ('z1886', 1886.0), ('z909', 909.0), ('z510', 510.0), ('z1954', 1954.0), ('z525', 525.0), ('z356', 356.0), ('z938', 938.0), ('z914', 914.0), ('z1109', 1109.0), ('z1808', 1808.0), ('z1565', 1565.0), ('z243', 243.0), ('z1189', 1189.0), ('z1043', 1043.0), ('z1218', 1218.0), ('z256', 256.0), ('z903', 903.0), ('z496', 496.0), ('z403', 403.0), ('z837', 837.0), ('z884', 884.0), ('z1597', 1597.0), ('z1336', 1336.0), ('z586', 586.0), ('z491', 491.0), ('z1708', 1708.0), ('z1443', 1443.0), ('z946', 946.0), ('z1309', 1309.0), ('z1237', 1237.0), ('z985', 985.0), ('z579', 579.0), ('z1634', 1634.0), ('z1324', 1324.0), ('z550', 550.0), ('z794', 794.0), ('z1317', 1317.0), ('z425', 425.0), ('z813', 813.0), ('z501', 501.0), ('z319', 319.0), ('z1554', 1554.0), ('z981', 981.0), ('z1041', 1041.0), ('z989', 989.0), ('z1299', 1299.0), ('z524', 524.0), ('z200', 200.0), ('z1573', 1573.0), ('z1424', 1424.0), ('z1351', 1351.0), ('z1410', 1410.0), ('z1524', 1524.0), ('z187', 187.0), ('z1676', 1676.0), ('z332', 332.0), ('z1102', 1102.0), ('z1765', 1765.0), ('z772', 772.0), ('z895', 895.0)])
<>>>>>>>>>>> (1678, [('z1057', 1057.0), ('z175', 175.0), ('z1729', 1729.0), ('z1953', 1953.0), ('z1186', 1186.0), ('z1388', 1388.0), ('z275', 275.0), ('z1523', 1523.0), ('z519', 519.0), ('z509', 509.0), ('z1947', 1947.0), ('z1635', 1635.0), ('z1072', 1072.0), ('z1893', 1893.0), ('z182', 182.0), ('z725', 725.0), ('z578', 578.0), ('z1766', 1766.0), ('z102', 102.0), ('z1315', 1315.0), ('z191', 191.0), ('z291', 291.0), ('z866', 866.0), ('z1690', 1690.0), ('z412', 412.0), ('z84', 84.0), ('z991', 991.0), ('z1629', 1629.0), ('z55', 55.0), ('z1284', 1284.0), ('z672', 672.0), ('z1593', 1593.0), ('z146', 146.0), ('z545', 545.0), ('z189', 189.0), ('z560', 560.0), ('z379', 379.0), ('z644', 644.0), ('z1781', 1781.0), ('z4', 4.0), ('z1224', 1224.0), ('z1101', 1101.0), ('z1533', 1533.0), ('z428', 428.0), ('z1288', 1288.0), ('z45', 45.0), ('z758', 758.0), ('z1025', 1025.0), ('z1985', 1985.0), ('z999', 999.0), ('z1273', 1273.0), ('z167', 167.0), ('z1587', 1587.0), ('z172', 172.0), ('z697', 697.0), ('z1541', 1541.0), ('z1290', 1290.0), ('z625', 625.0), ('z761', 761.0), ('z1233', 1233.0), ('z1813', 1813.0), ('z1606', 1606.0), ('z1727', 1727.0), ('z1658', 1658.0), ('z1375', 1375.0), ('z350', 350.0), ('z138', 138.0), ('z1933', 1933.0), ('z514', 514.0), ('z1976', 1976.0), ('z150', 150.0), ('z415', 415.0), ('z328', 328.0), ('z479', 479.0), ('z251', 251.0), ('z1905', 1905.0), ('z1764', 1764.0), ('z1722', 1722.0), ('z894', 894.0), ('z62', 62.0), ('z1179', 1179.0), ('z399', 399.0), ('z333', 333.0), ('z1689', 1689.0), ('z1646', 1646.0), ('z1090', 1090.0), ('z549', 549.0), ('z132', 132.0), ('z660', 660.0), ('z1718', 1718.0), ('z1166', 1166.0), ('z1949', 1949.0), ('z683', 683.0), ('z1266', 1266.0), ('z568', 568.0), ('z1667', 1667.0), ('z141', 141.0), ('z1807', 1807.0), ('z1730', 1730.0), ('z1695', 1695.0), ('z394', 394.0), ('z893', 893.0), ('z667', 667.0), ('z1969', 1969.0), ('z1487', 1487.0), ('z1326', 1326.0), ('z997', 997.0), ('z1307', 1307.0), ('z454', 454.0), ('z776', 776.0), ('z1045', 1045.0), ('z127', 127.0), ('z789', 789.0), ('z1175', 1175.0), ('z1139', 1139.0), ('z1663', 1663.0), ('z1167', 1167.0), ('z1387', 1387.0), ('z5', 5.0), ('z587', 587.0), ('z203', 203.0), ('z1303', 1303.0), ('z834', 834.0), ('z857', 857.0), ('z610', 610.0), ('z433', 433.0), ('z400', 400.0), ('z561', 561.0), ('z177', 177.0), ('z1684', 1684.0), ('z729', 729.0), ('z1143', 1143.0), ('z305', 305.0), ('z1506', 1506.0), ('z1488', 1488.0), ('z119', 119.0), ('z671', 671.0), ('z954', 954.0), ('z584', 584.0), ('z1031', 1031.0), ('z1911', 1911.0), ('z953', 953.0), ('z1628', 1628.0), ('z323', 323.0), ('z720', 720.0), ('z540', 540.0), ('z1200', 1200.0), ('z1665', 1665.0), ('z1147', 1147.0), ('z732', 732.0), ('z621', 621.0), ('z1868', 1868.0), ('z779', 779.0), ('z864', 864.0), ('z1246', 1246.0), ('z1591', 1591.0), ('z234', 234.0), ('z398', 398.0), ('z824', 824.0), ('z1827', 1827.0), ('z1544', 1544.0), ('z418', 418.0), ('z1003', 1003.0), ('z792', 792.0), ('z1498', 1498.0), ('z1084', 1084.0), ('z958', 958.0), ('z1915', 1915.0), ('z481', 481.0), ('z1753', 1753.0), ('z1972', 1972.0), ('z436', 436.0), ('z733', 733.0), ('z1687', 1687.0), ('z0', 0.0), ('z1733', 1733.0), ('z598', 598.0), ('z1828', 1828.0), ('z1632', 1632.0), ('z1651', 1651.0), ('z1624', 1624.0), ('z1215', 1215.0), ('z829', 829.0), ('z1551', 1551.0), ('z1216', 1216.0), ('z1863', 1863.0), ('z1320', 1320.0), ('z1283', 1283.0), ('z362', 362.0), ('z613', 613.0), ('z1145', 1145.0), ('z1968', 1968.0), ('z582', 582.0), ('z161', 161.0), ('z743', 743.0), ('z780', 780.0), ('z1760', 1760.0), ('z1155', 1155.0), ('z103', 103.0), ('z97', 97.0), ('z1793', 1793.0), ('z1411', 1411.0), ('z210', 210.0), ('z419', 419.0), ('z487', 487.0), ('z881', 881.0), ('z1085', 1085.0), ('z929', 929.0), ('z1826', 1826.0), ('z1111', 1111.0), ('z105', 105.0), ('z79', 79.0), ('z171', 171.0), ('z910', 910.0), ('z1785', 1785.0), ('z1415', 1415.0), ('z532', 532.0), ('z1066', 1066.0), ('z1435', 1435.0), ('z1978', 1978.0), ('z1779', 1779.0), ('z818', 818.0), ('z1539', 1539.0), ('z480', 480.0), ('z349', 349.0), ('z700', 700.0), ('z467', 467.0), ('z1475', 1475.0), ('z1279', 1279.0), ('z826', 826.0), ('z1204', 1204.0), ('z1042', 1042.0), ('z1125', 1125.0), ('z121', 121.0), ('z292', 292.0), ('z984', 984.0), ('z1240', 1240.0), ('z1701', 1701.0), ('z1289', 1289.0), ('z1005', 1005.0), ('z1783', 1783.0), ('z1396', 1396.0), ('z1015', 1015.0), ('z548', 548.0), ('z504', 504.0), ('z1322', 1322.0), ('z343', 343.0), ('z856', 856.0), ('z966', 966.0), ('z523', 523.0), ('z460', 460.0), ('z193', 193.0), ('z295', 295.0), ('z453', 453.0), ('z355', 355.0), ('z1483', 1483.0), ('z843', 843.0), ('z1294', 1294.0), ('z928', 928.0), ('z1861', 1861.0), ('z1673', 1673.0), ('z1366', 1366.0), ('z553', 553.0), ('z1568', 1568.0), ('z675', 675.0), ('z144', 144.0), ('z1500', 1500.0), ('z1878', 1878.0), ('z1572', 1572.0), ('z270', 270.0), ('z690', 690.0), ('z107', 107.0), ('z1726', 1726.0), ('z1112', 1112.0), ('z9', 9.0), ('z822', 822.0), ('z1698', 1698.0), ('z1255', 1255.0), ('z539', 539.0), ('z188', 188.0), ('z208', 208.0), ('z1973', 1973.0), ('z1612', 1612.0), ('z71', 71.0), ('z1398', 1398.0), ('z814', 814.0), ('z51', 51.0), ('z224', 224.0), ('z143', 143.0), ('z723', 723.0), ('z684', 684.0), ('z1741', 1741.0), ('z1188', 1188.0), ('z1110', 1110.0), ('z1263', 1263.0), ('z133', 133.0), ('z1345', 1345.0), ('z1348', 1348.0), ('z282', 282.0), ('z679', 679.0), ('z995', 995.0)])
<>>>>>>>>>>> (217, [('z34', 34.0), ('z1887', 1887.0), ('z1675', 1675.0), ('z95', 95.0), ('z1409', 1409.0), ('z544', 544.0), ('z860', 860.0), ('z760', 760.0), ('z1152', 1152.0), ('z1668', 1668.0), ('z931', 931.0), ('z1070', 1070.0), ('z1064', 1064.0), ('z382', 382.0), ('z1642', 1642.0), ('z14', 14.0), ('z178', 178.0), ('z1802', 1802.0), ('z693', 693.0), ('z174', 174.0), ('z1549', 1549.0), ('z1363', 1363.0), ('z1077', 1077.0), ('z1029', 1029.0), ('z33', 33.0), ('z642', 642.0), ('z1389', 1389.0), ('z1356', 1356.0), ('z50', 50.0), ('z904', 904.0), ('z762', 762.0), ('z461', 461.0), ('z1138', 1138.0), ('z445', 445.0), ('z386', 386.0), ('z301', 301.0), ('z1855', 1855.0), ('z1694', 1694.0), ('z1099', 1099.0), ('z1650', 1650.0), ('z444', 444.0), ('z775', 775.0), ('z442', 442.0), ('z1252', 1252.0), ('z741', 741.0), ('z1091', 1091.0), ('z309', 309.0), ('z847', 847.0), ('z1437', 1437.0), ('z1087', 1087.0), ('z1438', 1438.0), ('z1429', 1429.0), ('z906', 906.0), ('z1420', 1420.0), ('z1743', 1743.0), ('z858', 858.0), ('z370', 370.0), ('z1679', 1679.0), ('z1580', 1580.0), ('z924', 924.0), ('z1735', 1735.0), ('z26', 26.0), ('z1074', 1074.0), ('z647', 647.0), ('z392', 392.0), ('z1160', 1160.0), ('z1447', 1447.0), ('z659', 659.0), ('z1636', 1636.0), ('z1277', 1277.0), ('z918', 918.0), ('z1194', 1194.0), ('z1298', 1298.0), ('z562', 562.0), ('z645', 645.0), ('z1710', 1710.0), ('z1560', 1560.0), ('z1430', 1430.0), ('z288', 288.0), ('z698', 698.0), ('z805', 805.0), ('z1677', 1677.0), ('z1226', 1226.0), ('z1509', 1509.0), ('z1346', 1346.0), ('z1543', 1543.0), ('z1337', 1337.0), ('z1282', 1282.0), ('z1380', 1380.0), ('z365', 365.0), ('z1103', 1103.0), ('z401', 401.0), ('z209', 209.0), ('z782', 782.0), ('z1428', 1428.0), ('z595', 595.0), ('z1281', 1281.0), ('z1039', 1039.0), ('z1201', 1201.0), ('z239', 239.0), ('z785', 785.0), ('z835', 835.0), ('z1017', 1017.0), ('z1645', 1645.0), ('z1844', 1844.0), ('z648', 648.0), ('z457', 457.0), ('z1767', 1767.0), ('z1361', 1361.0), ('z371', 371.0), ('z36', 36.0), ('z861', 861.0), ('z342', 342.0), ('z1116', 1116.0), ('z7', 7.0), ('z1426', 1426.0), ('z787', 787.0), ('z378', 378.0), ('z920', 920.0), ('z1374', 1374.0), ('z801', 801.0), ('z692', 692.0), ('z1848', 1848.0), ('z1286', 1286.0), ('z1127', 1127.0), ('z1079', 1079.0), ('z359', 359.0), ('z1782', 1782.0), ('z1150', 1150.0), ('z868', 868.0), ('z1402', 1402.0), ('z1406', 1406.0), ('z153', 153.0), ('z1211', 1211.0), ('z1608', 1608.0), ('z124', 124.0), ('z973', 973.0), ('z1873', 1873.0), ('z1213', 1213.0), ('z313', 313.0), ('z1413', 1413.0), ('z1900', 1900.0), ('z1664', 1664.0), ('z1499', 1499.0), ('z1156', 1156.0), ('z935', 935.0), ('z315', 315.0), ('z1059', 1059.0), ('z1349', 1349.0), ('z515', 515.0), ('z274', 274.0), ('z139', 139.0), ('z96', 96.0), ('z1875', 1875.0), ('z1921', 1921.0), ('z1377', 1377.0), ('z530', 530.0), ('z39', 39.0), ('z1697', 1697.0), ('z1385', 1385.0), ('z186', 186.0), ('z603', 603.0), ('z1199', 1199.0), ('z1929', 1929.0), ('z689', 689.0), ('z905', 905.0), ('z486', 486.0), ('z1914', 1914.0), ('z1223', 1223.0), ('z1178', 1178.0), ('z441', 441.0), ('z475', 475.0), ('z1341', 1341.0), ('z201', 201.0), ('z321', 321.0), ('z1115', 1115.0), ('z335', 335.0), ('z194', 194.0), ('z1062', 1062.0), ('z1071', 1071.0), ('z1198', 1198.0), ('z707', 707.0), ('z1829', 1829.0), ('z1754', 1754.0), ('z1358', 1358.0), ('z1846', 1846.0), ('z681', 681.0), ('z850', 850.0), ('z1958', 1958.0), ('z1801', 1801.0), ('z1333', 1333.0), ('z875', 875.0), ('z1034', 1034.0), ('z1502', 1502.0), ('z1051', 1051.0), ('z352', 352.0), ('z614', 614.0), ('z1993', 1993.0), ('z1154', 1154.0), ('z1936', 1936.0), ('z1136', 1136.0), ('z1989', 1989.0), ('z1577', 1577.0), ('z48', 48.0), ('z600', 600.0), ('z331', 331.0), ('z823', 823.0), ('z784', 784.0), ('z1069', 1069.0), ('z1823', 1823.0), ('z476', 476.0), ('z1486', 1486.0), ('z56', 56.0), ('z325', 325.0), ('z633', 633.0), ('z756', 756.0), ('z1262', 1262.0), ('z1680', 1680.0), ('z1918', 1918.0), ('z238', 238.0), ('z1984', 1984.0), ('z1980', 1980.0), ('z1165', 1165.0), ('z1739', 1739.0), ('z1036', 1036.0), ('z774', 774.0), ('z628', 628.0), ('z463', 463.0), ('z134', 134.0), ('z993', 993.0), ('z164', 164.0), ('z1295', 1295.0), ('z1382', 1382.0), ('z110', 110.0), ('z641', 641.0), ('z1440', 1440.0), ('z1535', 1535.0), ('z1704', 1704.0), ('z992', 992.0), ('z1248', 1248.0), ('z1185', 1185.0), ('z1576', 1576.0), ('z940', 940.0), ('z1736', 1736.0), ('z631', 631.0), ('z1692', 1692.0), ('z236', 236.0), ('z217', 217.0), ('z1778', 1778.0), ('z408', 408.0), ('z384', 384.0), ('z1328', 1328.0), ('z1836', 1836.0), ('z1747', 1747.0), ('z78', 78.0), ('z666', 666.0), ('z1882', 1882.0), ('z1864', 1864.0), ('z1301', 1301.0), ('z1492', 1492.0), ('z1335', 1335.0), ('z197', 197.0), ('z766', 766.0), ('z1804', 1804.0), ('z1527', 1527.0), ('z1302', 1302.0), ('z91', 91.0), ('z1653', 1653.0), ('z137', 137.0), ('z483', 483.0), ('z716', 716.0), ('z35', 35.0), ('z125', 125.0), ('z395', 395.0), ('z346', 346.0), ('z1469', 1469.0), ('z939', 939.0), ('z1181', 1181.0), ('z1564', 1564.0), ('z1300', 1300.0), ('z1197', 1197.0), ('z1770', 1770.0), ('z1920', 1920.0), ('z1083', 1083.0), ('z1625', 1625.0), ('z1563', 1563.0), ('z580', 580.0), ('z702', 702.0), ('z1305', 1305.0), ('z1797', 1797.0), ('z790', 790.0), ('z1013', 1013.0), ('z1711', 1711.0), ('z237', 237.0), ('z1297', 1297.0), ('z871', 871.0), ('z357', 357.0), ('z1439', 1439.0), ('z447', 447.0), ('z368', 368.0)])
<>>>>>>>>>>> (1411, [('z1811', 1811.0), ('z336', 336.0), ('z770', 770.0), ('z1238', 1238.0), ('z1556', 1556.0), ('z307', 307.0), ('z462', 462.0), ('z1946', 1946.0), ('z1603', 1603.0), ('z942', 942.0), ('z1786', 1786.0), ('z1987', 1987.0), ('z219', 219.0), ('z1622', 1622.0), ('z1561', 1561.0), ('z1740', 1740.0), ('z482', 482.0), ('z1788', 1788.0), ('z1357', 1357.0), ('z1265', 1265.0), ('z1230', 1230.0), ('z287', 287.0), ('z714', 714.0), ('z1182', 1182.0), ('z1883', 1883.0), ('z731', 731.0), ('z1595', 1595.0), ('z490', 490.0), ('z1903', 1903.0), ('z1516', 1516.0), ('z195', 195.0), ('z1532', 1532.0), ('z1250', 1250.0), ('z526', 526.0), ('z1824', 1824.0), ('z977', 977.0), ('z1627', 1627.0), ('z230', 230.0), ('z253', 253.0), ('z1006', 1006.0), ('z651', 651.0), ('z806', 806.0), ('z950', 950.0), ('z1879', 1879.0), ('z25', 25.0), ('z1206', 1206.0), ('z1170', 1170.0), ('z533', 533.0), ('z1227', 1227.0), ('z1755', 1755.0), ('z777', 777.0), ('z1737', 1737.0), ('z1205', 1205.0), ('z388', 388.0), ('z1272', 1272.0), ('z1948', 1948.0), ('z1505', 1505.0), ('z517', 517.0), ('z1130', 1130.0), ('z28', 28.0), ('z432', 432.0), ('z1390', 1390.0), ('z643', 643.0), ('z1235', 1235.0), ('z1567', 1567.0), ('z1939', 1939.0), ('z1441', 1441.0), ('z1171', 1171.0), ('z1966', 1966.0), ('z1806', 1806.0), ('z1691', 1691.0), ('z715', 715.0), ('z1805', 1805.0), ('z46', 46.0), ('z1820', 1820.0), ('z912', 912.0), ('z1392', 1392.0), ('z135', 135.0), ('z1490', 1490.0), ('z994', 994.0), ('z147', 147.0), ('z536', 536.0), ('z1026', 1026.0), ('z1418', 1418.0), ('z303', 303.0), ('z551', 551.0), ('z202', 202.0), ('z815', 815.0), ('z120', 120.0), ('z1514', 1514.0), ('z465', 465.0), ('z629', 629.0), ('z245', 245.0), ('z869', 869.0), ('z901', 901.0), ('z1460', 1460.0), ('z181', 181.0), ('z248', 248.0), ('z1940', 1940.0), ('z1709', 1709.0), ('z885', 885.0), ('z1096', 1096.0), ('z204', 204.0), ('z1784', 1784.0), ('z1618', 1618.0), ('z1997', 1997.0), ('z1999', 1999.0), ('z1843', 1843.0), ('z656', 656.0), ('z1258', 1258.0), ('z1030', 1030.0), ('z1169', 1169.0), ('z1162', 1162.0), ('z207', 207.0), ('z1529', 1529.0), ('z886', 886.0), ('z1378', 1378.0), ('z1436', 1436.0), ('z1659', 1659.0), ('z1631', 1631.0), ('z1141', 1141.0), ('z52', 52.0), ('z122', 122.0), ('z1790', 1790.0), ('z1519', 1519.0), ('z1135', 1135.0), ('z810', 810.0), ('z1614', 1614.0), ('z1399', 1399.0), ('z1384', 1384.0), ('z706', 706.0), ('z990', 990.0), ('z1468', 1468.0), ('z1463', 1463.0), ('z24', 24.0), ('z556', 556.0), ('z1319', 1319.0), ('z1995', 1995.0), ('z827', 827.0), ('z1448', 1448.0), ('z308', 308.0), ('z1731', 1731.0), ('z855', 855.0), ('z828', 828.0), ('z1950', 1950.0), ('z630', 630.0), ('z1372', 1372.0), ('z1479', 1479.0), ('z1542', 1542.0), ('z242', 242.0), ('z1203', 1203.0), ('z240', 240.0), ('z1531', 1531.0), ('z1501', 1501.0), ('z375', 375.0), ('z1126', 1126.0), ('z284', 284.0), ('z1060', 1060.0), ('z1792', 1792.0), ('z1776', 1776.0), ('z1121', 1121.0), ('z1120', 1120.0), ('z558', 558.0), ('z1040', 1040.0), ('z1986', 1986.0), ('z908', 908.0), ('z1024', 1024.0), ('z1866', 1866.0), ('z94', 94.0), ('z1373', 1373.0), ('z746', 746.0), ('z1528', 1528.0), ('z31', 31.0), ('z1140', 1140.0), ('z1', 1.0), ('z389', 389.0), ('z126', 126.0), ('z1466', 1466.0), ('z6', 6.0), ('z1869', 1869.0), ('z658', 658.0), ('z691', 691.0), ('z1858', 1858.0), ('z272', 272.0), ('z1462', 1462.0), ('z1163', 1163.0), ('z718', 718.0), ('z1028', 1028.0), ('z1975', 1975.0), ('z1763', 1763.0), ('z250', 250.0), ('z1476', 1476.0), ('z1260', 1260.0), ('z1607', 1607.0), ('z223', 223.0), ('z1859', 1859.0), ('z47', 47.0), ('z1092', 1092.0), ('z573', 573.0), ('z74', 74.0), ('z57', 57.0), ('z65', 65.0), ('z1837', 1837.0), ('z547', 547.0), ('z221', 221.0), ('z1569', 1569.0), ('z1885', 1885.0), ('z148', 148.0), ('z1314', 1314.0), ('z1208', 1208.0), ('z112', 112.0), ('z10', 10.0), ('z93', 93.0), ('z821', 821.0), ('z932', 932.0), ('z163', 163.0), ('z1596', 1596.0), ('z925', 925.0), ('z1395', 1395.0), ('z840', 840.0), ('z158', 158.0), ('z324', 324.0), ('z198', 198.0), ('z615', 615.0), ('z819', 819.0), ('z640', 640.0), ('z1432', 1432.0), ('z358', 358.0), ('z43', 43.0), ('z922', 922.0), ('z588', 588.0), ('z16', 16.0), ('z1332', 1332.0), ('z1164', 1164.0), ('z528', 528.0), ('z1831', 1831.0), ('z1207', 1207.0), ('z430', 430.0), ('z747', 747.0), ('z508', 508.0), ('z1771', 1771.0), ('z216', 216.0), ('z1467', 1467.0), ('z1860', 1860.0), ('z130', 130.0), ('z1033', 1033.0), ('z617', 617.0), ('z883', 883.0), ('z968', 968.0), ('z227', 227.0), ('z1256', 1256.0), ('z1700', 1700.0), ('z249', 249.0), ('z1184', 1184.0), ('z393', 393.0), ('z1405', 1405.0), ('z1686', 1686.0), ('z872', 872.0), ('z372', 372.0), ('z1881', 1881.0), ('z1772', 1772.0), ('z294', 294.0), ('z902', 902.0), ('z413', 413.0), ('z619', 619.0), ('z145', 145.0), ('z162', 162.0), ('z471', 471.0), ('z836', 836.0), ('z1899', 1899.0), ('z37', 37.0), ('z1851', 1851.0), ('z1891', 1891.0), ('z1449', 1449.0), ('z802', 802.0), ('z879', 879.0), ('z1959', 1959.0), ('z337', 337.0), ('z1912', 1912.0), ('z448', 448.0), ('z736', 736.0), ('z620', 620.0), ('z1148', 1148.0), ('z136', 136.0), ('z1016', 1016.0), ('z1671', 1671.0), ('z670', 670.0), ('z1850', 1850.0), ('z1408', 1408.0), ('z1187', 1187.0), ('z220', 220.0), ('z752', 752.0), ('z632', 632.0), ('z1930', 1930.0), ('z867', 867.0), ('z1815', 1815.0), ('z1012', 1012.0), ('z900', 900.0), ('z1000', 1000.0), ('z755', 755.0), ('z1146', 1146.0)])
<>>>>>>>>>>> (1639, [('z1268', 1268.0), ('z1190', 1190.0), ('z1877', 1877.0), ('z1080', 1080.0), ('z1452', 1452.0), ('z1956', 1956.0), ('z740', 740.0), ('z1672', 1672.0), ('z184', 184.0), ('z176', 176.0), ('z911', 911.0), ('z1757', 1757.0), ('z1168', 1168.0), ('z1908', 1908.0), ('z1716', 1716.0), ('z1699', 1699.0), ('z1678', 1678.0), ('z1570', 1570.0), ('z874', 874.0), ('z1553', 1553.0), ('z1098', 1098.0), ('z1484', 1484.0), ('z40', 40.0), ('z300', 300.0), ('z1575', 1575.0), ('z1582', 1582.0), ('z1941', 1941.0), ('z1902', 1902.0), ('z1707', 1707.0), ('z575', 575.0), ('z1661', 1661.0), ('z1267', 1267.0), ('z214', 214.0), ('z374', 374.0), ('z1107', 1107.0), ('z1937', 1937.0), ('z952', 952.0), ('z1339', 1339.0), ('z281', 281.0), ('z851', 851.0), ('z555', 555.0), ('z298', 298.0), ('z1210', 1210.0), ('z1114', 1114.0), ('z602', 602.0), ('z1291', 1291.0), ('z488', 488.0), ('z1515', 1515.0), ('z511', 511.0), ('z170', 170.0), ('z1078', 1078.0), ('z1325', 1325.0), ('z1517', 1517.0), ('z1035', 1035.0), ('z3', 3.0), ('z1841', 1841.0), ('z1610', 1610.0), ('z1304', 1304.0), ('z1362', 1362.0), ('z1253', 1253.0), ('z965', 965.0), ('z518', 518.0), ('z699', 699.0), ('z1464', 1464.0), ('z1195', 1195.0), ('z477', 477.0), ('z226', 226.0), ('z853', 853.0), ('z833', 833.0), ('z1423', 1423.0), ('z109', 109.0), ('z1979', 1979.0), ('z1296', 1296.0), ('z247', 247.0), ('z173', 173.0), ('z769', 769.0), ('z474', 474.0), ('z116', 116.0), ('z252', 252.0), ('z921', 921.0), ('z258', 258.0), ('z322', 322.0), ('z1988', 1988.0), ('z734', 734.0), ('z1957', 1957.0), ('z373', 373.0), ('z1522', 1522.0), ('z68', 68.0), ('z183', 183.0), ('z937', 937.0), ('z1616', 1616.0), ('z1364', 1364.0), ('z727', 727.0), ('z1002', 1002.0), ('z1480', 1480.0), ('z1048', 1048.0), ('z306', 306.0), ('z366', 366.0), ('z1751', 1751.0), ('z1644', 1644.0), ('z1023', 1023.0), ('z316', 316.0), ('z263', 263.0), ('z535', 535.0), ('z268', 268.0), ('z1454', 1454.0), ('z279', 279.0), ('z1376', 1376.0), ('z1340', 1340.0), ('z917', 917.0), ('z73', 73.0), ('z749', 749.0), ('z1970', 1970.0), ('z1745', 1745.0), ('z1128', 1128.0), ('z627', 627.0), ('z852', 852.0), ('z1050', 1050.0), ('z1961', 1961.0), ('z1212', 1212.0), ('z469', 469.0), ('z1819', 1819.0), ('z759', 759.0), ('z1491', 1491.0), ('z1977', 1977.0), ('z1832', 1832.0), ('z1176', 1176.0), ('z1431', 1431.0), ('z1497', 1497.0), ('z1153', 1153.0), ('z1482', 1482.0), ('z800', 800.0), ('z498', 498.0), ('z567', 567.0), ('z1327', 1327.0), ('z311', 311.0), ('z1047', 1047.0), ('z930', 930.0), ('z1001', 1001.0), ('z115', 115.0), ('z1251', 1251.0), ('z1073', 1073.0), ('z1021', 1021.0), ('z1232', 1232.0), ('z1054', 1054.0), ('z100', 100.0), ('z778', 778.0), ('z1106', 1106.0), ('z314', 314.0), ('z30', 30.0), ('z859', 859.0), ('z485', 485.0), ('z27', 27.0), ('z1538', 1538.0), ('z1236', 1236.0), ('z1599', 1599.0), ('z1952', 1952.0), ('z1174', 1174.0), ('z427', 427.0), ('z1871', 1871.0), ('z123', 123.0), ('z983', 983.0), ('z1306', 1306.0), ('z1280', 1280.0), ('z661', 661.0), ('z19', 19.0), ('z652', 652.0), ('z936', 936.0), ('z1712', 1712.0), ('z1681', 1681.0), ('z1534', 1534.0), ('z564', 564.0), ('z364', 364.0), ('z196', 196.0), ('z1158', 1158.0), ('z1540', 1540.0), ('z570', 570.0), ('z211', 211.0), ('z505', 505.0), ('z155', 155.0), ('z75', 75.0), ('z1822', 1822.0), ('z1401', 1401.0), ('z410', 410.0), ('z962', 962.0), ('z1010', 1010.0), ('z360', 360.0), ('z1076', 1076.0), ('z996', 996.0), ('z1134', 1134.0), ('z1842', 1842.0), ('z85', 85.0), ('z1682', 1682.0), ('z1574', 1574.0), ('z1276', 1276.0), ('z72', 72.0), ('z190', 190.0), ('z1904', 1904.0), ('z205', 205.0), ('z825', 825.0), ('z1118', 1118.0), ('z1038', 1038.0), ('z1925', 1925.0), ('z637', 637.0), ('z1228', 1228.0), ('z484', 484.0), ('z737', 737.0), ('z807', 807.0), ('z104', 104.0), ('z1620', 1620.0), ('z1359', 1359.0), ('z1243', 1243.0), ('z1817', 1817.0), ('z1639', 1639.0), ('z1142', 1142.0), ('z431', 431.0), ('z811', 811.0), ('z213', 213.0), ('z915', 915.0), ('z1027', 1027.0), ('z712', 712.0), ('z1720', 1720.0), ('z1613', 1613.0), ('z38', 38.0), ('z1367', 1367.0), ('z820', 820.0), ('z972', 972.0), ('z569', 569.0), ('z1590', 1590.0), ('z576', 576.0), ('z967', 967.0), ('z1270', 1270.0), ('z1451', 1451.0), ('z1601', 1601.0), ('z998', 998.0), ('z455', 455.0), ('z1821', 1821.0), ('z816', 816.0), ('z1009', 1009.0), ('z255', 255.0), ('z426', 426.0), ('z1403', 1403.0), ('z417', 417.0), ('z654', 654.0), ('z1518', 1518.0), ('z1249', 1249.0), ('z913', 913.0), ('z865', 865.0), ('z1971', 1971.0), ('z1998', 1998.0), ('z106', 106.0), ('z1791', 1791.0), ('z1355', 1355.0), ('z1065', 1065.0), ('z949', 949.0), ('z69', 69.0), ('z1481', 1481.0), ('z81', 81.0), ('z1748', 1748.0), ('z1581', 1581.0), ('z11', 11.0), ('z1422', 1422.0), ('z1275', 1275.0), ('z241', 241.0), ('z947', 947.0), ('z1369', 1369.0), ('z58', 58.0), ('z1780', 1780.0), ('z302', 302.0), ('z1974', 1974.0), ('z767', 767.0), ('z1732', 1732.0), ('z611', 611.0), ('z618', 618.0), ('z842', 842.0), ('z1478', 1478.0), ('z907', 907.0), ('z60', 60.0), ('z765', 765.0), ('z703', 703.0), ('z1493', 1493.0), ('z982', 982.0), ('z788', 788.0), ('z89', 89.0), ('z970', 970.0), ('z1548', 1548.0), ('z1407', 1407.0), ('z63', 63.0), ('z1724', 1724.0), ('z1761', 1761.0), ('z1870', 1870.0), ('z1474', 1474.0), ('z919', 919.0), ('z1852', 1852.0), ('z1381', 1381.0), ('z1075', 1075.0), ('z1909', 1909.0), ('z635', 635.0), ('z1592', 1592.0), ('z1173', 1173.0)])
<>>>>>>>>>>> (0, [('z1217', 1217.0), ('z537', 537.0), ('z443', 443.0), ('z1161', 1161.0), ('z304', 304.0), ('z809', 809.0), ('z1193', 1193.0), ('z49', 49.0), ('z971', 971.0), ('z1244', 1244.0), ('z1693', 1693.0), ('z1242', 1242.0), ('z1758', 1758.0), ('z1014', 1014.0), ('z1922', 1922.0), ('z876', 876.0), ('z1312', 1312.0), ('z1938', 1938.0), ('z980', 980.0), ('z1924', 1924.0), ('z1365', 1365.0), ('z13', 13.0), ('z1180', 1180.0), ('z1504', 1504.0), ('z286', 286.0), ('z114', 114.0), ('z1559', 1559.0), ('z111', 111.0), ('z1768', 1768.0), ('z423', 423.0), ('z1834', 1834.0), ('z1058', 1058.0), ('z259', 259.0), ('z1717', 1717.0), ('z1123', 1123.0), ('z1578', 1578.0), ('z1931', 1931.0), ('z1379', 1379.0), ('z262', 262.0), ('z12', 12.0), ('z1446', 1446.0), ('z1617', 1617.0), ('z1897', 1897.0), ('z1489', 1489.0), ('z409', 409.0), ('z711', 711.0), ('z1794', 1794.0), ('z1225', 1225.0), ('z534', 534.0), ('z803', 803.0), ('z608', 608.0), ('z754', 754.0), ('z1331', 1331.0), ('z626', 626.0), ('z798', 798.0), ('z854', 854.0), ('z688', 688.0), ('z1916', 1916.0), ('z1872', 1872.0), ('z974', 974.0), ('z1898', 1898.0), ('z1951', 1951.0), ('z353', 353.0), ('z32', 32.0), ('z1391', 1391.0), ('z1923', 1923.0), ('z1434', 1434.0), ('z722', 722.0), ('z1756', 1756.0), ('z1588', 1588.0), ('z422', 422.0), ('z151', 151.0), ('z597', 597.0), ('z1053', 1053.0), ('z1254', 1254.0), ('z424', 424.0), ('z830', 830.0), ('z601', 601.0), ('z1510', 1510.0), ('z1234', 1234.0), ('z559', 559.0), ('z889', 889.0), ('z1271', 1271.0), ('z797', 797.0), ('z1370', 1370.0), ('z710', 710.0), ('z1221', 1221.0), ('z1652', 1652.0), ('z1723', 1723.0), ('z1245', 1245.0), ('z1812', 1812.0), ('z54', 54.0), ('z1342', 1342.0), ('z1994', 1994.0), ('z44', 44.0), ('z882', 882.0), ('z1239', 1239.0), ('z1789', 1789.0), ('z1867', 1867.0), ('z607', 607.0), ('z1473', 1473.0), ('z470', 470.0), ('z735', 735.0), ('z748', 748.0), ('z662', 662.0), ('z719', 719.0), ('z1458', 1458.0), ('z832', 832.0), ('z1416', 1416.0), ('z590', 590.0), ('z1334', 1334.0), ('z636', 636.0), ('z1647', 1647.0), ('z726', 726.0), ('z344', 344.0), ('z669', 669.0), ('z650', 650.0), ('z757', 757.0), ('z472', 472.0), ('z1845', 1845.0), ('z1512', 1512.0), ('z1853', 1853.0), ('z1222', 1222.0), ('z1067', 1067.0), ('z1508', 1508.0), ('z233', 233.0), ('z742', 742.0), ('z839', 839.0), ('z1880', 1880.0), ('z948', 948.0), ('z500', 500.0), ('z1457', 1457.0), ('z1196', 1196.0), ('z271', 271.0), ('z753', 753.0), ('z1095', 1095.0), ('z1414', 1414.0), ('z466', 466.0), ('z159', 159.0), ('z276', 276.0), ('z1386', 1386.0), ('z156', 156.0), ('z61', 61.0), ('z1960', 1960.0), ('z1928', 1928.0), ('z59', 59.0), ('z701', 701.0), ('z1137', 1137.0), ('z404', 404.0), ('z414', 414.0), ('z1571', 1571.0), ('z987', 987.0), ('z646', 646.0), ('z1944', 1944.0), ('z329', 329.0), ('z563', 563.0), ('z730', 730.0), ('z892', 892.0), ('z1945', 1945.0), ('z1094', 1094.0), ('z1046', 1046.0), ('z1313', 1313.0), ('z334', 334.0), ('z709', 709.0), ('z845', 845.0), ('z1583', 1583.0), ('z296', 296.0), ('z396', 396.0), ('z267', 267.0), ('z260', 260.0), ('z1638', 1638.0), ('z1656', 1656.0), ('z1525', 1525.0), ('z527', 527.0), ('z572', 572.0), ('z493', 493.0), ('z1445', 1445.0), ('z1615', 1615.0), ('z896', 896.0), ('z1799', 1799.0), ('z653', 653.0), ('z1662', 1662.0), ('z1503', 1503.0), ('z18', 18.0), ('z17', 17.0), ('z464', 464.0), ('z541', 541.0), ('z957', 957.0), ('z42', 42.0), ('z1890', 1890.0), ('z265', 265.0), ('z678', 678.0), ('z1032', 1032.0), ('z1795', 1795.0), ('z266', 266.0)])
 

相关语法:

zscan key cursor [MATCH pattern] [COUNT count]

Scan 说明

官方对 Scan 命令的描述信息如下。

Scan guarantees

The SCAN command, and the other commands in the SCAN family, are able to provide to the user a set of guarantees associated to full iterations.

  • A full iteration always retrieves all the elements that were present in the collection from the start to the end of a full iteration. This means that if a given element is inside the collection when an iteration is started, and is still there when an iteration terminates, then at some point SCANreturned it to the user.
  • A full iteration never returns any element that was NOT present in the collection from the start to the end of a full iteration. So if an element was removed before the start of an iteration, and is never added back to the collection for all the time an iteration lasts, SCAN ensures that this element will never be returned.

However because SCAN has very little state associated (just the cursor) it has the following drawbacks:

  • A given element may be returned multiple times. It is up to the application to handle the case of duplicated elements, for example only using the returned elements in order to perform operations that are safe when re-applied multiple times.
  • Elements that were not constantly present in the collection during a full iteration, may be returned or not: it is undefined.

官方文档地址:

SCAN – Redis

翻译为中文的含义是:Scan 及它的相关命令可以保证以下查询规则。

  • 它可以完整返回开始到结束检索集合中出现的所有元素,也就是在整个查询过程中如果这些元素没有被删除,且符合检索条件,则一定会被查询出来;
  • 它可以保证不会查询出,在开始检索之前删除的那些元素。

然后,Scan 命令包含以下缺点:

  • 一个元素可能被返回多次,需要客户端来实现去重;
  • 在迭代过程中如果有元素被修改,那么修改的元素能不能被遍历到不确定。

小结

通过本文我们可以知道 Scan 包含以下四个指令:

  1. Scan:用于检索当前数据库中所有数据;
  2. HScan:用于检索哈希类型的数据;
  3. SScan:用于检索集合类型中的数据;
  4. ZScan:由于检索有序集合中的数据。

Scan 具备以下几个特点:

  1. Scan 可以实现 keys 的匹配功能;
  2. Scan 是通过游标进行查询的不会导致 Redis 假死;
  3. Scan 提供了 count 参数,可以规定遍历的数量;
  4. Scan 会把游标返回给客户端,用户客户端继续遍历查询;
  5. Scan 返回的结果可能会有重复数据,需要客户端去重;
  6. 单次返回空值且游标不为 0,说明遍历还没结束;
  7. Scan 可以保证在开始检索之前,被删除的元素一定不会被查询出来;
  8. 在迭代过程中如果有元素被修改, Scan 不保证能查询出相关的元素。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值