Help Center> DataArts Studio> FAQs> DataArts DataService> 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?
Updated on 2023-11-30 GMT+08:00

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.

Figure 1 Return Total Records

Parameters

Table 1 Parameter description

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.

Figure 2 Total number of data records

DataArts DataService FAQs

more