Running a Query | VantageCloud Lake - Running the Query - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-02-17
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
Whether your query runs on the primary cluster or a compute cluster depends on the following:
  • Whether an active compute cluster belongs to a compute group associated with your user account
  • Location of the tables your query references

    The following table shows where your queries run depending on where your tables are stored and which compute components are available.

Table Locations Where Query Runs
Primary cluster block storage only Primary cluster
External object storage (used with NOS) only Compute cluster
Object File System (OFS) only Compute cluster
OFS and primary cluster block storage Depends on size of data needed to run query.

If Optimizer determines it is cheaper to send small block storage data to the compute cluster, the query runs on compute cluster. If the block storage data is much larger than OFS data, the query runs on the primary cluster.

To run a query:

  1. Make sure you have access to a compute group. See Granting Users Access to Compute Clusters.
  2. Log on to the database from the Console or from a client.
  3. Run the query:
    SELECT TD1.KeyCol,
        TD2.NameCol,
        NOS3.DescCol,
        SUM(OFS4.QtyCol)
    FROM
        TD_EventType1 TD1,
        TD_EventDesc2 TD2,
        NOS_External3 NOS3,
        OFS_Event4 OFS4
    WHERE TD1.KeyCol = TD2.KeyCol
    AND TD1.PKCol = NOS3.FKCol
    AND TD1.PKCol = OFS4.FKCol
    AND OFS4.ProcDate BETWEEN
        '1996-06-01' AND '1996-06-07'
    GROUP BY
        TD1.KeyCol,
        TD2.NameCol
        NOS3.DescCol
    ORDER BY SUM(OFS4.QtyCol) DESC;

Once the query is submitted, a query plan determines what part of the query runs on the primary cluster and what part runs on a compute cluster. The query plan chooses the primary cluster to run the portion of the query that accesses data stored on tables in Block Storage. The query plan chooses the compute cluster to run the portion of the query that accesses data stored on tables in the Object File System (OFS_Event4 in the example) and tables stored on Native Object Store (NOS_External3 in the example). When the query completes the results are returned to the user. The query plan optimizes the query steps between the primary cluster and the compute clusters in order to maximize the performance of the query.