v.21.1New Features

Add Limit and Offset Settings for Out-of-SQL Pagination in ClickHouse

Add settings limit and offset for out-of-SQL pagination: #16176 They are useful for building APIs. These two settings will affect SELECT query as if it is added like select * from (your_original_select_query) t limit xxx offset xxx;. #17633 (hexiaoting).
Added new settings limit and offset for out-of-SQL pagination to SELECT queries in ClickHouse.

Why it matters

These settings allow users to implement pagination externally to the SQL query, simplifying API development by applying limit and offset directly to the query results without modifying the original query structure.

How to use it

Set the limit and/or offset settings in the session or query level. These settings cause ClickHouse to internally transform the query as if it were wrapped like SELECT * FROM (your_original_select_query) t LIMIT <limit> OFFSET <offset>, enabling pagination outside of the SQL statement itself.