Updated on 2024-01-22 GMT+08:00

Function

In MySQL Community Edition, If you use LIMIT(N) and OFFSET(P) in a SELECT statement, the engine layer returns all rows that meet the WHERE condition to the SQL layer for processing. The SQL layer skip P rows of data and returns N rows of data. When a secondary index needs to access the columns in the primary table, the engine layer returns the table to obtain all required column information. If OFFSET value (P) is much greater than the LIMIT value (N), the engine layer sends a large amount of data to the SQL layer for processing.

In GaussDB(for MySQL), If you use LIMIT(N) and OFFSET(P) in a SELECT statement, data is pushed down to the engine layer for processing, speeding up queries.