- 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:
- Make sure you have access to a compute group. See Granting Users Access to Compute Clusters.
- Log on to the database from the Console or from a client.
- 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.