Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Not a Bug
-
Affects Version/s: 5.5.35-galera
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
When a search is on a 5 character cid, it should be able to use a cid(255) index.
| CREATE TABLE `cache_data` ( `cidhash` binary(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0' COMMENT 'Hash of cid - for quick lookups.', `cid` varchar(1024) NOT NULL DEFAULT '' COMMENT 'Cache ID.', `data` longblob COMMENT 'A collection of data to cache.', `expire` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.', `created` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry was created.', `serialized` smallint(6) NOT NULL DEFAULT '0' COMMENT 'A flag to indicate whether content is serialized (1) or not (0).', `tags` longtext COMMENT 'Space-separated list of cache tags for this entry.', `checksum_invalidations` int(11) NOT NULL DEFAULT '0' COMMENT 'The tag invalidation sum when this entry was saved.', `checksum_deletions` int(11) NOT NULL DEFAULT '0' COMMENT 'The tag deletion sum when this entry was saved.', PRIMARY KEY (`cidhash`,`cid`(255)), KEY `expire` (`expire`), KEY `created` (`created`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Storage for the cache API.' |
MariaDB [drupal_dev]> explain extended SELECT cid, data, created, expire, serialized, tags, checksum_invalidations, checksum_deletions FROM cache_data WHERE cidhash = '�D�a?��7���о�U6�' AND cid = 'test1'; | id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +------+-------------+-------+------+---------------+------+---------+------+------+----------+-----------------------------------------------------+ | 1 | SIMPLE | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | Impossible WHERE noticed after reading const tables |
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
It does if there is anything to find:
insert into cache_data values ('foo','test1','foo',1,1,1,'foo',1,1), ('bar','test2','bar',1,1,1,'bar',1,1); explain extended SELECT cid, data, created, expire, serialized, tags, checksum_invalidations, checksum_deletions FROM cache_data WHERE cidhash = 'foo\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0' AND cid = 'test1'; +------+-------------+------------+-------+---------------+---------+---------+-------------+------+----------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +------+-------------+------------+-------+---------------+---------+---------+-------------+------+----------+-------+ | 1 | SIMPLE | cache_data | const | PRIMARY | PRIMARY | 787 | const,const | 1 | 100.00 | | +------+-------------+------------+-------+---------------+---------+---------+-------------+------+----------+-------+Or did you mean something different?