Current location - Loan Platform Complete Network - Big data management - How does pagehelper work in mysql?
How does pagehelper work in mysql?
pager is similar to Linux's pipeline, which gives output to another command as input. The powerful thing is that the commands connected to this pipe are Linux commands, so we can use our familiar Linux commands to realize various kinds of operation. Without further ado, here are some examples.

Paging

mysql> pager lessPAGER set to 'less'mysql> show engine innodb status\G1 row in set (0.00 sec)

innodb status output is very long, and it's a good idea to use the Linux command less. The Linux command less enables paging, and again you can use more depending on your personal preference.

Find Search

Generally we want to see what slow SQLs are running at the moment, we can query the processlist table in the information_schema with the following commands, which requires you to be familiar with the metadata table.

Close pager after using pager remember to cancel it, the cancelation is also very simple, there are three ways.

#Common method, set pager back to the original default (stdout)

mysql> pager

Default pager wasn't set, using stdout.

#Shut down pager

mysql> nopager

PAGER set to stdout

#Quit client, reconnect

mysql> quit

Bye