Example 1: Using fetch-limit and fetch-count - 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

To issue the query in ACT with a fetch-count of 100 and a fetch-limit of 1000:

\set  fetch-count  100
 \set fetch-limit 1000 
SELECT * FROM FOO, BAR where FOO.A = BAR.A;

Here is how the query will execute:

  1. ACT opens a cursor on the query.
  2. The queen activates Parallel Cursors and passes the query
    SELECT * FROM FOO, BAR where FOO.A = BAR.A;

    to the workers.

  3. Each worker then computes the entire equi-join as dictated by the FOO.A = BAR.A constraint.
  4. The queen fetches results from workers in batches of 100 rows, until a limit of 1000 is reached.
  5. ACT fetches results from the queen in batches of 100 rows, until a limit of 1000 is reached.