我最近从MySQL切换到了MariaDB,有些查询不再起作用。
示例: 我有一个包含150.000行的表,并执行以下查询:
SELECT * FROM table LIMIT 122000,100
当然,那需要几秒钟,但应该可以。在MySQL上,它可以正常工作,但是使用MariaDB时,查询会不断加载和加载,而不会发生任何事情(服务器负载会增加)。 我使用的是同一引擎(MyISAM),却不知道如何解决。 有人知道我可以更改配置中的某些内容以使其正常工作吗? 我有点困惑,因为它可用于MySQL,但不适用于MariaDB。
谢谢。
一些其他信息:
CREATE TABLE `posts` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`user_hash` 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',
`title` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`search` text CHARACTER SET utf8 DEFAULT NULL,
`forumid` tinyint(3) unsigned NOT NULL DEFAULT 0,
`timecount` bigint(20) unsigned NOT NULL DEFAULT 0,
`added` int(11) unsigned NOT NULL DEFAULT 0,
`poststatus` enum('open','closed') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'open',
`likes` int(10) unsigned NOT NULL DEFAULT 0,
`comments` tinyint(3) unsigned NOT NULL DEFAULT 0,
`views` smallint(5) unsigned NOT NULL DEFAULT 0,
`hits` smallint(5) unsigned NOT NULL DEFAULT 0,
`thanks` smallint(5) unsigned NOT NULL DEFAULT 0,
`upvotes` smallint(5) unsigned NOT NULL DEFAULT 0,
`downvotes` smallint(5) unsigned NOT NULL DEFAULT 0,
`last_answer` int(11) unsigned NOT NULL DEFAULT 0,
`hidden` enum('yes','no') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'no',
`userid` mediumint(8) unsigned NOT NULL DEFAULT 0,
`last_edit` int(11) unsigned NOT NULL DEFAULT 0,
`username` varchar(40) CHARACTER SET utf8 DEFAULT NULL,
`extralink` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`editreason` varchar(100) CHARACTER SET utf8 DEFAULT NULL,
`last_vote` int(11) unsigned NOT NULL DEFAULT 0,
`style` enum('legacy','modern','default') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'default',
`genre` varchar(100) CHARACTER SET utf8 DEFAULT NULL,
`last_thanks` int(11) unsigned NOT NULL DEFAULT 0,
`last_reply_username` varchar(40) CHARACTER SET utf8 DEFAULT NULL,
`approved_at` int(11) unsigned NOT NULL DEFAULT 0,
`start` int(11) unsigned NOT NULL DEFAULT 0,
`end` int(11) unsigned NOT NULL DEFAULT 0,
`thread_status` enum('default','removed','awaiting') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'default',
`refered_by` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`cid` int(11) unsigned DEFAULT 0,
`options` int(10) unsigned DEFAULT 1,
`rating` float(3,1) unsigned DEFAULT NULL,
`tags` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `user_hash` (`user_hash`),
UNIQUE KEY `title` (`title`),
KEY `username` (`username`),
KEY `visible` (`visible`),
KEY `added` (`added`),
KEY `upvotes` (`upvotes`),
KEY `downvotes` (`downvotes`),
KEY `last_answer` (`last_answer`),
KEY `likes` (`likes`),
KEY `comments` (`comments`),
KEY `thanks` (`thanks`),
KEY `hits` (`hits`),
KEY `last_reply_username` (`last_reply_username`),
KEY `last_thanks` (`last_thanks`),
KEY `status` (`status`),
KEY `refered_by` (`refered_by`),
KEY `browse_index` (`forumid`,`hidden`,`style`),
KEY `forumid` (`forumid`),
KEY `style` (`style`),
KEY `last_vote` (`last_vote`),
KEY `hidden` (`hidden`,`style`),
KEY `cid` (`cid`),
KEY `options` (`options`),
FULLTEXT KEY `title` (`title`),
FULLTEXT KEY `search` (`search`),
FULLTEXT KEY `genre` (`genre`),
FULLTEXT KEY `tags` (`tags`)
) ENGINE=MyISAM AUTO_INCREMENT=610700 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
{
"data":
[
{
"Name": "posts",
"Engine": "MyISAM",
"Version": 10,
"Row_format": "Dynamic",
"Rows": 146228,
"Avg_row_length": 251,
"Data_length": 36803536,
"Max_data_length": 281474976710655,
"Index_length": 80322560,
"Data_free": 0,
"Auto_increment": 610707,
"Create_time": "2018-11-08 00:21:32",
"Update_time": "2018-11-09 00:46:14",
"Check_time": "2018-11-08 00:27:52",
"Collation": "utf8_unicode_ci",
"Checksum": null,
"Create_options": "",
"Comment": "",
"Max_index_length": 288230376151710720,
"Temporary": "N"
}
]
}