Get the App
SLTechnology News&Howtos  ›  Database  › 

What is the reason why offset affects performance too much when querying mysql?

Shulou Source: shulou.com Published: 2022-05-31 20:02:04 10月02日 Update

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

Tags: Data index query efficiency reason performance impact content field offset situation article structure problem analysis test difference big only datasheet Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux macOS vpn MySQL OPPO Reno