Limit Caching With Server-Side Cursors - Aster Client

Teradata Aster® Client Guide

Product
Aster Client
Release Number
7.00
Published
May 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
hki1475000360386.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
B700-2005
lifecycle
previous
Product Category
Software

Setting use-server-cursors has the same effect as declaring a server-side cursor with the DECLARE CURSOR syntax in SQL. When server-side cursors are activated, one batch of data is retrieved at a time. This lets the queen avoid caching the entire result set and lets the workers continue performing computations while the queen is retrieving rows. As the result set becomes available from a worker, the queen sends it to the client.

Depending on the type of query, results can start streaming back to the client immediately (e.g. SELECT * WHERE...) or the results may have to be computed in their entirety (e.g. GROUP BY) before streaming to the client. Regardless of whether the results begin to stream to the client before the query has finished executing, server-side cursors can improve performance significantly for large result sets. If you want to start streaming results of a query as soon as possible, you can benefit from setting use-server-cursors and specifying a fetch-count. By default, use-server-cursors is set to 0 (off).