MySQL paging query optimization case

On December 25, when viewing the monitoring of a customer, it was found that the customer had executed page by page queries for more than 60s. The execution status is as follows: This is a very simple and typical page query SQL. khome_space.regdate column has an index, and the table has more than three million rows of data. The offset of the q ...

Posted by paulsiew2 on Sat, 04 Jan 2020 00:08:17 +0100

JOIN and UNION in SQL

Building tables Create table tb and insert data: CREATE TABLE `tb_clazz` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'class id', `grade` varchar(64) DEFAULT NULL COMMENT 'Class name', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4; INSERT INTO `tb_clazz` (`id`, `grade`) VALUES ...

Posted by gabrielkolbe on Thu, 02 Jan 2020 13:53:07 +0100

Paging with mybatis PageHelper

frame address: https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/HowToUse.md Reference documents address: https://blog.csdn.net/she_lock/article/details/79975907 pom dependence <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</a ...

Posted by madsosterby on Thu, 02 Jan 2020 10:47:17 +0100

Spring Data JPA learning

1, Spring Data JPA 1, introduction (1) Official website address:  https://spring.io/projects/spring-data-jpaReference documents:  https://docs.spring.io/spring-data/jpa/docs/2.2.3.RELEASE/reference/html/#preface (2) Basic introduction:Spring Data JPA is a set of JPA framework based on ORM framework and JPA specification encapsulation of spr ...

Posted by DanAuito on Thu, 02 Jan 2020 03:24:15 +0100

Mysql join table sql collation

Mysql join table sql collation This paper sorts out some sql usage of mysql join table: Mysql join table sql collation TABLE statement Linked table query Linked list updating Linked list deletion view TABLE statement /*Table structure for table `departments` */ CREATE TABLE `departments` ( `department_id` int ...

Posted by V34 on Thu, 02 Jan 2020 00:17:12 +0100

Batch modification of IPOS friendly terminal group

Due to the needs of the company, it is necessary to change the transfer mode of IPOS friendly terminal group and IPOS friendly terminal group Because this operation is very troublesome and tedious, close-up this template, batch update and one click completion excel table format 2 tables in total At present, each store h ...

Posted by hiberphoptik on Wed, 01 Jan 2020 05:25:18 +0100

mysqld key functions and execution flow of MySQL8.0.11 source code analysis

mysqld is the SQL daemons (that is, the MySQL server). To use the client program, it must run because the client accesses the database by connecting to the server. //Linux entry function int mysqld_main(int argc, char **argv){ ...... //Initialize operation //Cyclic connection mysqld_socket_acceptor->connecti ...

Posted by dswain on Tue, 31 Dec 2019 22:00:41 +0100

About MySQL 5.7 enabling bin log master-slave replication

Master-slave replication: generally used for real-time backup. The next steps are as follows: master master database configuration synchronization, slave database configuration synchronization, master lock table / backup, slave data recovery, slave synchronization enabled, master unlocking, and completion. ##################### mysql5.7 bin-lo ...

Posted by croix on Tue, 31 Dec 2019 18:38:36 +0100

MySQL group summary takes the first N records

score table: CREATE TABLE `score` ( `student_id` int(10) DEFAULT NULL, `class_id` int(10) DEFAULT NULL, `score` int(5) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci Field student ID student ID, class ID: class ID, score: Score Data preparation: insert into score values(1,1,100),(2,1,93 ...

Posted by ltd on Sun, 29 Dec 2019 20:12:42 +0100

Use of Oracle (3) cursor

Vernier [introduction] we can use the cursor to locate our mouse. If we want to find a specific row in the table, we can use the cursor to locate it. [general structure] declare cursor is sql statement begin open name; fetch a variable with the name into; exit when condition; close name end; [example 1] use the curso ...

Posted by Liz_SA on Thu, 26 Dec 2019 21:01:41 +0100