今日の非常に奇妙な問題。基本的な数学と同じくらい簡単なクエリ:
MariaDB [betradar]> select id,id_event,id_bookmaker from event_outcome where id like '%16069689%';
+----------+----------+--------------+
| id | id_event | id_bookmaker |
+----------+----------+--------------+
| 16069689 | 11198 | 14 |
+----------+----------+--------------+
しかし、これは私を夢中にさせます:
MariaDB [betradar]> select id,id_event from event_outcome where id=16069689;
Empty set (0.00 sec)
つまり、データはすぐそこにありますが、選択はデータを返しません。これはクラスター化されたキーに関連する問題ですか? 私のテーブル:
CREATE TABLE `event_outcome` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`id_event` int(11) unsigned NOT NULL,
`id_outcome` int(11) unsigned NOT NULL,
`id_bookmaker` int(11) unsigned NOT NULL,
`outcome_type` varchar(50) DEFAULT NULL ,
`quotation` decimal(10,2) NOT NULL,
`quotation_datetime` datetime DEFAULT NULL,
`is_last` tinyint(1) unsigned zerofill NOT NULL DEFAULT '0',
`create_time` int(11) DEFAULT '0',
`update_time` int(11) DEFAULT '0',
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`mp_read` tinyint(4) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_event` (`id_event`),
KEY `idx_outcome` (`id_outcome`),
KEY `idx_bookmaker` (`id_bookmaker`),
KEY `idx_is_last` (`is_last`),
KEY `idx_outcome_type` (`outcome_type`),
KEY `clstr_event` (`id_event`,`id_outcome`,`id_bookmaker`,`is_last`,`mp_read`) `clustering`=yes
) ENGINE=TokuDB AUTO_INCREMENT=16632394 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT `compression`='tokudb_zlib'