@@ -1338,6 +1338,23 @@ INSERT INTO meta_table VALUES (100, 0, 4, 0, 'data4', 1, 2, 3, 'context4',
133813381, 0x1, 1, 1, 1, 1, 1, 0, 0);
13391339INSERT INTO meta_table VALUES (101, 0, 1, 0, 'data1', 1, 2, 3, 'context1',
134013401, 0x1, 1, 1, 1, 1, 1, 0, 0);
1341+ CREATE TABLE `time_range` (
1342+ `id1` bigint unsigned NOT NULL DEFAULT '0' ,
1343+ `id1_type` int unsigned NOT NULL DEFAULT '0' ,
1344+ `id2` bigint unsigned NOT NULL DEFAULT '0' ,
1345+ `id2_type` int unsigned NOT NULL DEFAULT '0' ,
1346+ `link_type` bigint unsigned NOT NULL DEFAULT '0' ,
1347+ `time` int unsigned NOT NULL DEFAULT '0' ,
1348+ PRIMARY KEY (`link_type` , `id1` , `id2`) COMMENT 'cf_link' ,
1349+ KEY `id1_type` (`id1`,`link_type`,`time`,`id2`)
1350+ COMMENT 'rev:cf_link_id1_type'
1351+ ) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin
1352+ ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
1353+ INSERT INTO time_range VALUES (100, 10, 200, 20, 1000, 1);
1354+ INSERT INTO time_range VALUES (100, 10, 201, 21, 1000, 2);
1355+ INSERT INTO time_range VALUES (100, 10, 202, 22, 1000, 3);
1356+ INSERT INTO time_range VALUES (100, 10, 203, 23, 1000, 4);
1357+ INSERT INTO time_range VALUES (100, 10, 204, 24, 1000, 5);
13411358========== Verifying Bypass Query ==========
13421359WITH BYPASS:
13431360SELECT /*+ bypass */ `mt_object_state`, `id`, `mt_object_cookie`,
@@ -1468,6 +1485,197 @@ id2 version data
14681485include/assert.inc [Verify not executed in bypass]
14691486include/assert.inc [Verify bypass and regular query return same number of rows]
14701487include/assert.inc [Verify bypass reads no more than regular query]
1488+ ========== Verifying Bypass Query ==========
1489+ WITH BYPASS:
1490+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1491+ (id1_type) WHERE link_type=1000 AND id1=100 AND time>=1 AND time>=2 AND time>=3
1492+ ORDER BY time ASC, id2 ASC limit 0,1000;
1493+ id1 id2 link_type time
1494+ 100 202 1000 3
1495+ 100 203 1000 4
1496+ 100 204 1000 5
1497+ ROWS_READ
1498+ 3
1499+ COVERED_SK_LOOKUP
1500+ 3
1501+ include/assert.inc [Verify executed in bypass]
1502+ WITHOUT BYPASS:
1503+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1504+ (id1_type) WHERE link_type=1000 AND id1=100 AND time>=1 AND time>=2 AND time>=3
1505+ ORDER BY time ASC, id2 ASC limit 0,1000;
1506+ id1 id2 link_type time
1507+ 100 202 1000 3
1508+ 100 203 1000 4
1509+ 100 204 1000 5
1510+ include/assert.inc [Verify not executed in bypass]
1511+ include/assert.inc [Verify bypass and regular query return same number of rows]
1512+ include/assert.inc [Verify bypass reads no more than regular query]
1513+ ========== Verifying Bypass Query ==========
1514+ WITH BYPASS:
1515+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1516+ (id1_type) WHERE link_type=1000 AND id1=100 AND time>=2 AND time>=1 AND time>=3
1517+ ORDER BY time ASC, id2 ASC limit 0,1000;
1518+ id1 id2 link_type time
1519+ 100 202 1000 3
1520+ 100 203 1000 4
1521+ 100 204 1000 5
1522+ ROWS_READ
1523+ 3
1524+ COVERED_SK_LOOKUP
1525+ 3
1526+ include/assert.inc [Verify executed in bypass]
1527+ WITHOUT BYPASS:
1528+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1529+ (id1_type) WHERE link_type=1000 AND id1=100 AND time>=2 AND time>=1 AND time>=3
1530+ ORDER BY time ASC, id2 ASC limit 0,1000;
1531+ id1 id2 link_type time
1532+ 100 202 1000 3
1533+ 100 203 1000 4
1534+ 100 204 1000 5
1535+ include/assert.inc [Verify not executed in bypass]
1536+ include/assert.inc [Verify bypass and regular query return same number of rows]
1537+ include/assert.inc [Verify bypass reads no more than regular query]
1538+ ========== Verifying Bypass Query ==========
1539+ WITH BYPASS:
1540+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1541+ (id1_type) WHERE link_type=1000 AND id1=100 AND time>=3 AND time>=2 AND time>=1
1542+ ORDER BY time ASC, id2 ASC limit 0,1000;
1543+ id1 id2 link_type time
1544+ 100 202 1000 3
1545+ 100 203 1000 4
1546+ 100 204 1000 5
1547+ ROWS_READ
1548+ 3
1549+ COVERED_SK_LOOKUP
1550+ 3
1551+ include/assert.inc [Verify executed in bypass]
1552+ WITHOUT BYPASS:
1553+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1554+ (id1_type) WHERE link_type=1000 AND id1=100 AND time>=3 AND time>=2 AND time>=1
1555+ ORDER BY time ASC, id2 ASC limit 0,1000;
1556+ id1 id2 link_type time
1557+ 100 202 1000 3
1558+ 100 203 1000 4
1559+ 100 204 1000 5
1560+ include/assert.inc [Verify not executed in bypass]
1561+ include/assert.inc [Verify bypass and regular query return same number of rows]
1562+ include/assert.inc [Verify bypass reads no more than regular query]
1563+ ========== Verifying Bypass Query ==========
1564+ WITH BYPASS:
1565+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1566+ (id1_type) WHERE link_type=1000 AND id1=100 AND time<=3 AND time<=4 AND time<=5
1567+ ORDER BY time ASC, id2 ASC limit 0,1000;
1568+ id1 id2 link_type time
1569+ 100 200 1000 1
1570+ 100 201 1000 2
1571+ 100 202 1000 3
1572+ ROWS_READ
1573+ 3
1574+ COVERED_SK_LOOKUP
1575+ 3
1576+ include/assert.inc [Verify executed in bypass]
1577+ WITHOUT BYPASS:
1578+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1579+ (id1_type) WHERE link_type=1000 AND id1=100 AND time<=3 AND time<=4 AND time<=5
1580+ ORDER BY time ASC, id2 ASC limit 0,1000;
1581+ id1 id2 link_type time
1582+ 100 200 1000 1
1583+ 100 201 1000 2
1584+ 100 202 1000 3
1585+ include/assert.inc [Verify not executed in bypass]
1586+ include/assert.inc [Verify bypass and regular query return same number of rows]
1587+ include/assert.inc [Verify bypass reads no more than regular query]
1588+ ========== Verifying Bypass Query ==========
1589+ WITH BYPASS:
1590+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1591+ (id1_type) WHERE link_type=1000 AND id1=100 AND time<=4 AND time<=3 AND time<=5
1592+ ORDER BY time ASC, id2 ASC limit 0,1000;
1593+ id1 id2 link_type time
1594+ 100 200 1000 1
1595+ 100 201 1000 2
1596+ 100 202 1000 3
1597+ ROWS_READ
1598+ 3
1599+ COVERED_SK_LOOKUP
1600+ 3
1601+ include/assert.inc [Verify executed in bypass]
1602+ WITHOUT BYPASS:
1603+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1604+ (id1_type) WHERE link_type=1000 AND id1=100 AND time<=4 AND time<=3 AND time<=5
1605+ ORDER BY time ASC, id2 ASC limit 0,1000;
1606+ id1 id2 link_type time
1607+ 100 200 1000 1
1608+ 100 201 1000 2
1609+ 100 202 1000 3
1610+ include/assert.inc [Verify not executed in bypass]
1611+ include/assert.inc [Verify bypass and regular query return same number of rows]
1612+ include/assert.inc [Verify bypass reads no more than regular query]
1613+ ========== Verifying Bypass Query ==========
1614+ WITH BYPASS:
1615+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1616+ (id1_type) WHERE link_type=1000 AND id1=100 AND time>=5 AND time<=4 AND time<=3
1617+ ORDER BY time ASC, id2 ASC limit 0,1000;
1618+ id1 id2 link_type time
1619+ ROWS_READ
1620+ 0
1621+ COVERED_SK_LOOKUP
1622+ 0
1623+ include/assert.inc [Verify executed in bypass]
1624+ WITHOUT BYPASS:
1625+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1626+ (id1_type) WHERE link_type=1000 AND id1=100 AND time>=5 AND time<=4 AND time<=3
1627+ ORDER BY time ASC, id2 ASC limit 0,1000;
1628+ id1 id2 link_type time
1629+ include/assert.inc [Verify not executed in bypass]
1630+ include/assert.inc [Verify bypass and regular query return same number of rows]
1631+ include/assert.inc [Verify bypass reads no more than regular query]
1632+ ========== Verifying Bypass Query ==========
1633+ WITH BYPASS:
1634+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1635+ (id1_type) WHERE link_type=1000 AND id1=100 AND time>=1 AND time>=3 AND
1636+ time<=5 AND time<=4 ORDER BY time ASC, id2 ASC limit 0,1000;
1637+ id1 id2 link_type time
1638+ 100 202 1000 3
1639+ 100 203 1000 4
1640+ ROWS_READ
1641+ 2
1642+ COVERED_SK_LOOKUP
1643+ 2
1644+ include/assert.inc [Verify executed in bypass]
1645+ WITHOUT BYPASS:
1646+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1647+ (id1_type) WHERE link_type=1000 AND id1=100 AND time>=1 AND time>=3 AND
1648+ time<=5 AND time<=4 ORDER BY time ASC, id2 ASC limit 0,1000;
1649+ id1 id2 link_type time
1650+ 100 202 1000 3
1651+ 100 203 1000 4
1652+ include/assert.inc [Verify not executed in bypass]
1653+ include/assert.inc [Verify bypass and regular query return same number of rows]
1654+ include/assert.inc [Verify bypass reads no more than regular query]
1655+ ========== Verifying Bypass Query ==========
1656+ WITH BYPASS:
1657+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1658+ (id1_type) WHERE link_type=1000 AND id1=100 AND time<=5 AND time>=3 AND
1659+ time<=4 AND time>=1 ORDER BY time ASC, id2 ASC limit 0,1000;
1660+ id1 id2 link_type time
1661+ 100 202 1000 3
1662+ 100 203 1000 4
1663+ ROWS_READ
1664+ 2
1665+ COVERED_SK_LOOKUP
1666+ 2
1667+ include/assert.inc [Verify executed in bypass]
1668+ WITHOUT BYPASS:
1669+ SELECT /*+ bypass */ id1,id2,link_type,time FROM time_range FORCE INDEX
1670+ (id1_type) WHERE link_type=1000 AND id1=100 AND time<=5 AND time>=3 AND
1671+ time<=4 AND time>=1 ORDER BY time ASC, id2 ASC limit 0,1000;
1672+ id1 id2 link_type time
1673+ 100 202 1000 3
1674+ 100 203 1000 4
1675+ include/assert.inc [Verify not executed in bypass]
1676+ include/assert.inc [Verify bypass and regular query return same number of rows]
1677+ include/assert.inc [Verify bypass reads no more than regular query]
1678+ DROP TABLE time_range;
14711679# Establish connection con1 (user=root)
14721680# Switch to connection con1
14731681========== Verifying Bypass Query ==========
@@ -1506,4 +1714,4 @@ FROM performance_schema.global_status WHERE
15061714variable_name="rocksdb_select_bypass_executed";
15071715SELECT @executed_end-@executed_start AS ROCKSDB_SELECT_BYPASS_EXECUTED;
15081716ROCKSDB_SELECT_BYPASS_EXECUTED
1509- 52
1717+ 60
0 commit comments