Open Teradata Viewer: Quick Guide to Getting Started

Step-by-Step: Open Teradata Viewer for SQL Query Inspection

What you’ll need

  • Teradata Viewpoint or Teradata client installed (Teradata Studio, Teradata SQL Assistant, or another viewer that supports TD query inspection).
  • Credentials with permission to view queries on the target Teradata system.
  • Network access to the Teradata server (VPN or direct connection if required).

1. Launch the viewer application

  1. Open your chosen Teradata client (e.g., Teradata Viewpoint web console, Teradata Studio, or SQL Assistant).
  2. If using Viewpoint, point your browser to the Viewpoint URL and sign in with your credentials.

2. Connect to the Teradata system

  1. In the client, create or select a connection profile for the target Teradata host.
  2. Enter hostname/IP, port (default 1025 for some clients), username, and password. Save the profile if you will reuse it.
  3. Test the connection and connect.

3. Navigate to the query inspection area

  • Teradata Viewpoint: Open the “Query Monitor” or “Viewpoint Performance” portlets (such as Query Monitor, DBQL Query Log, or Query Grid) to see active and recent queries.
  • Teradata Studio: Use the “SQL History” or “Query Monitor” perspective/tab.
  • SQL Assistant: Use the “History” or “DBQL” report to view past queries.

4. Locate the query you want to inspect

  1. Filter by user, time range, client application, or SQL text to narrow results.
  2. Sort by start time, elapsed time, or CPU to find slow or relevant queries.
  3. Select the query from the list to view details.

5. Inspect query details

  • SQL text: Review the full statement to confirm what was executed.
  • Execution plan: Open the explain plan to see join order, indexes, and cost estimates.
  • Resource usage: Check elapsed time, CPU, I/O, and spool usage to assess performance impact.
  • Session info: Note session ID, user, client, and node(s) involved.
  • DBQL/Query Log: If enabled, review DBQL fields for compilation time, parsing, and associated metrics.

6. Use Explain and Visual Explain

  1. Copy the SQL text into the Explain feature (or right-click → Explain) in your viewer.
  2. Run Explain to generate a textual plan; open Visual Explain if available for a graphical plan showing steps and estimated costs.
  3. Interpret join types (hash, merge), redistribution steps, and hotspots where data moves between AMPs.

7. Diagnose common performance issues

  • Skewed data distribution: Look for steps with uneven AMP work or high spool on specific nodes.
  • Large redistributions: Identify unnecessary repartitions or product joins causing network cost.
  • Missing statistics: Check for Full or Partial scans that indicate missing stats; collect stats as needed.
  • Poor indexing: Examine access paths that fall back to full table scans.

8. Take corrective actions

  1. Add or update statistics on columns used in joins and predicates.
  2. Rewrite queries to reduce redistributions (e.g., use joins on well-distributed columns, avoid functions on join keys).
  3. Consider primary index changes or partitioning for long-term fixes.
  4. Test changes in a non-production environment and re-run Explain to compare plans.

9. Save and export findings

  • Export the SQL, Explain plan, and metrics as files or screenshots for reporting.
  • Document session IDs and timestamps for follow-up with DBAs or developers.

10. Follow-up monitoring

  • Re-run queries during peak load to ensure fixes hold.
  • Use Viewpoint dashboards or scheduled DBQL reports to track regressions over time.

Tips

  • Always run Explain without executing the query in production when possible.
  • Use time filters and user filters to reduce noise when searching logs.
  • Coordinate with DBAs when making changes to statistics, indexes, or primary indices.

If you want, I can tailor these steps to a specific Teradata viewer (Viewpoint, Studio, or SQL Assistant) — tell me which one and I’ll adapt the walkthrough.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *