40 lines
2.8 KiB
Plaintext
40 lines
2.8 KiB
Plaintext
CREATE TABLE `linktable` (
|
|
`id1` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`id1_type` int(10) unsigned NOT NULL DEFAULT '0',
|
|
`id2` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`id2_type` int(10) unsigned NOT NULL DEFAULT '0',
|
|
`link_type` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`visibility` tinyint(3) NOT NULL DEFAULT '0',
|
|
`data` varchar(255) NOT NULL DEFAULT '',
|
|
`time` bigint(20) unsigned NOT NULL DEFAULT '0',
|
|
`version` int(11) unsigned NOT NULL DEFAULT '0',
|
|
PRIMARY KEY (link_type, `id1`,`id2`) COMMENT 'cf_link_pk',
|
|
KEY `id1_type` (`id1`,`link_type`,`visibility`,`time`,`id2`,`version`,`data`) COMMENT 'rev:cf_link_id1_type'
|
|
) ENGINE=XEngine DEFAULT COLLATE=latin1_bin;
|
|
Warnings:
|
|
Warning 1681 Integer display width is deprecated and will be removed in a future release.
|
|
Warning 1681 Integer display width is deprecated and will be removed in a future release.
|
|
Warning 1681 Integer display width is deprecated and will be removed in a future release.
|
|
Warning 1681 Integer display width is deprecated and will be removed in a future release.
|
|
Warning 1681 Integer display width is deprecated and will be removed in a future release.
|
|
Warning 1681 Integer display width is deprecated and will be removed in a future release.
|
|
Warning 1681 Integer display width is deprecated and will be removed in a future release.
|
|
Warning 1681 Integer display width is deprecated and will be removed in a future release.
|
|
set global xengine_force_flush_memtable_now=1;
|
|
insert into linktable (id1, link_type, id2) values (2, 1, 1);
|
|
insert into linktable (id1, link_type, id2) values (2, 1, 2);
|
|
insert into linktable (id1, link_type, id2) values (2, 1, 3);
|
|
insert into linktable (id1, link_type, id2) values (2, 1, 4);
|
|
insert into linktable (id1, link_type, id2) values (2, 1, 5);
|
|
insert into linktable (id1, link_type, id2) values (2, 1, 6);
|
|
insert into linktable (id1, link_type, id2) values (2, 1, 7);
|
|
insert into linktable (id1, link_type, id2) values (2, 1, 8);
|
|
insert into linktable (id1, link_type, id2) values (2, 1, 9);
|
|
insert into linktable (id1, link_type, id2) values (2, 1, 10);
|
|
explain select id1, id2, link_type, data from linktable force index(primary) where id1=2 and link_type=1 and (id2=1 or id2=2 or id2=3 or id2=4 or id2=5);
|
|
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
|
1 SIMPLE linktable NULL range PRIMARY PRIMARY 24 NULL # 100.00 Using where
|
|
Warnings:
|
|
Note 1003 /* select#1 */ select `test`.`linktable`.`id1` AS `id1`,`test`.`linktable`.`id2` AS `id2`,`test`.`linktable`.`link_type` AS `link_type`,`test`.`linktable`.`data` AS `data` from `test`.`linktable` FORCE INDEX (PRIMARY) where ((`test`.`linktable`.`link_type` = 1) and (`test`.`linktable`.`id1` = 2) and ((`test`.`linktable`.`id2` = 1) or (`test`.`linktable`.`id2` = 2) or (`test`.`linktable`.`id2` = 3) or (`test`.`linktable`.`id2` = 4) or (`test`.`linktable`.`id2` = 5)))
|
|
drop table linktable;
|