v.21.1New Features
Add Limit and Offset Settings for Out-of-SQL Pagination in ClickHouse
Add settingslimitandoffsetfor out-of-SQL pagination: #16176 They are useful for building APIs. These two settings will affect SELECT query as if it is added likeselect * from (your_original_select_query) t limit xxx offset xxx;. #17633 (hexiaoting).
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 thelimit 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.