Run a Query | Teradata VantageCloud Lake - Run the Query - Teradata VantageCloud Lake

Lake - Getting Started with VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-03-04
dita:mapPath
egi1682536329712.ditamap
dita:ditavalPath
qmm1686677572606.ditaval
dita:id
egi1682536329712
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 or primary cluster
Object File System (OFS) only Compute cluster or primary 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. Sign in 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.