The connection options described in this section directly affect the performance of your driver. To tune for performance, configure your driver according to the recommended settings and your environment.

Fetch Size/Web Service Fetch Size (FetchSize/WSFetchSize): The connection options Fetch Size and Web Service Fetch Size can be used to adjust the trade-off between throughput and response time. In general, setting larger values for Web Service Fetch Size and Fetch Size will improve throughput, but can reduce response time.

For example, if an application attempts to fetch 100,000 rows from the remote data source and Web Service Fetch Size is set to 500, the driver must make 200 Web service calls to get the 100,000 rows. If, however, Web Service Fetch Size is set to 4000, the driver only needs to make 25 Web service calls to retrieve 100,000 rows. Web service calls are expensive, so generally, minimizing Web service calls increases throughput. In addition, many Cloud data sources impose limits on the number of Web service calls that can be made in a given period of time. Minimizing the number of Web service calls used to fetch data also can help prevent exceeding the data source call limits.

For many applications, throughput is the primary performance measure, but for interactive applications, such as Web applications, response time (how fast the first set of data is returned) is more important than throughput. For example, suppose that you have a Web application that displays data 50 rows to a page and that, on average, you view three or four pages. Response time can be improved by setting Fetch Size to 50 (the number of rows displayed on a page) and WSFetch Size to 200. With these settings, the driver fetches all of the rows from the remote data source that you would typically view in a single Web service call and only processes the rows needed to display the first page.

Use Storage API (UseStorageAPI): The Use Storage API connection option can be used to improve performance by enabling the driver to use the Google BigQuery Storage API when fetching large result sets. When Use Storage API is set to enabled, the driver uses the Storage API for selects when the number of rows in the result set exceeds the value of the Storage API Threshold option, and the number of pages in the result set exceeds the value of the Storage API Min Page Count option.

Use Streaming Insert (UseStreamingInsert): The Use Streaming Insert connection option can be used to improve performance by enabling the driver to use the Google BigQuery Streaming API for executing batch inserts. When Use Streaming Insert is set to enabled, the driver uses the Streaming API for insert operations with the tabledata.insertAll method.

Web Service Pool Size (WSPoolSize): Web Service Pool Size determines the maximum number of sessions the driver uses when there are multiple active connections to a REST service. By increasing this number, you increase the number of sessions the driver uses to distribute calls to a REST service, thereby improving throughput and performance. For example, if this option is set to 1, and you have two open connections, the session must complete a call from one connection before it can begin processing a call from the other connection. However, if Web Service Pool Size is set to 2, a second session is opened that allows calls from both connections to be processed simultaneously.
Note: The number specified for Web Service Pool Size should not exceed the amount of sessions permitted by your REST service.