What Should I Do If It Takes a Long Time to Obtain the Total Number of Data Records of a Table Through an API If the Table Contains a Large Amount of Data?
Scenario
If a table contains a large amount of data, obtaining the total number of data records of the table through an API is time-consuming. During a pagination query, the use_total_num parameter can be used to determine whether the total number of data records is calculated and returned.
Prerequisites
During API creation, Return Total Records is enabled on the Set Data Extract Logic page.
![](https://support.huaweicloud.com/intl/en-us/dataartsstudio_faq/en-us_image_0000001612423861.png)
Parameters
Parameter |
use_total_num |
Mandatory |
No. By default, the total number of data records is returned. |
Location |
Query |
Type |
String |
Description |
Value 1 means to return the total number of data records, and any other value means the opposite. |
Suggestion
In the first pagination query, add parameter use_total_num and set its value to 1 to obtain the total number of data records. In subsequent requests, add parameter use_total_num and set its value to 0 so that the total number of data records is not returned.
![](https://support.huaweicloud.com/intl/en-us/dataartsstudio_faq/en-us_image_0000001612444781.png)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot