What is the reason why offset affects performance too much when querying mysql?
This article mainly introduces the mysql query offset too much impact on the performance of what is the reason, has a certain reference value, interested friends can refer to, I hope you read this article after a lot of gains, the following let Xiaobian with everyone to understand.
Prepare test data sheets and data
1. create tables
CREATE TABLE `member` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(10) NOT NULL COMMENT 'lastname',`gender` tinyint(3) unsigned NOT NULL COMMENT ' gender', PRIMARY KEY (`id`), KEY `gender` (`gender`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2. Insert 1000000 records