In general, when we pull or retrieve certain data objects, data is returned in batches based on pagination, rather than returning all data in a single request.Documentation Index
Fetch the complete documentation index at: https://docs.flashcat.cloud/llms.txt
Use this file to discover all available pages before exploring further.
Traditional Pagination
We define pagination technology based on OFFSET and LIMIT queries as traditional pagination. In most Flashduty list query APIs, you can see the following parameter definitions:
Request Parameters
| Parameter | Type | Description |
|---|---|---|
p | number | Page number, starting from 1 by default. offset = (p - 1) * limit |
limit | number | Number of items per page, maximum value not exceeding 100, default is 20 |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
total | number | Total number of matched entries under current conditions |
has_next_page | boolean | Whether there is next page data under current conditions |
Example
- Request Example
- Response Example
Potential Issues
Although querying based on traditional pagination technology is simple, you may encounter the following issues:Performance Issues
Performance Issues
When using OFFSET and LIMIT for paginated queries, the database needs to skip a specified number of rows (OFFSET) and then return a specified number of rows (LIMIT). As the offset increases, query performance may decrease, especially when handling large amounts of data. Each query needs to scan and skip the previous rows, which causes queries to become slower and slower.
Data Instability
Data Instability
When using PAGE and LIMIT for paginated queries, if data is deleted or inserted during the query, results may become unstable. For example, if previous rows are deleted during the query process, subsequent offsets may become invalid, leading to inaccurate or missing results.
Query Limits
To protect the system and ensure stable access for most users, we have imposed the following restrictions on API parameters based on traditional pagination technology:Cursor Pagination
We define pagination technology based on SEARCH_AFTER_CTX as cursor pagination. Cursor pagination technology can better handle large datasets and high-performance requirements, providing a more stable and efficient paginated query experience.
Supported APIs
We provide cursor pagination support in the following APIs:Request Parameters
| Parameter | Type | Description |
|---|---|---|
search_after_ctx | string | Cursor index, starts from the first page when not set |
limit | number | Number of items per page, maximum value not exceeding 100, default is 20 |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
total | number | Total number of matched entries under current conditions |
has_next_page | boolean | Whether there is next page data under current conditions |
search_after_ctx | string | Next page cursor address, returned only when next page exists |
Example
- Request Example
- Response Example
About TOTAL
Regardless of which pagination technology is used, Flashduty will return
total and has_next_page parameters. However, please note that the total value is not always accurate. To ensure the system can respond quickly, we have added the following restrictions: