MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Teradata No Primary Index (NOPI) Table

#Contents
1.What is NO PRIMARY INDEX (NOPI) Table?
2.How’s row distributed in AMP for No PRIMARY INDEX (NOPI) table?
3.How it can be determine which AMP gets which No PRIMARY INDEX (NOPI) row?
4.What will happen if we don’t define the Primary Index in the DDL statement while CREATING TABLE?
5.Why create a table with No Primary Index (NOPI)?
6.How do NOPI tables affect query performance?
7.No Primary Index (NOPI ) tables can be skewed or not?
8.How to find No Primary Index (NOPI) tables?
9.What are the Limitations No Primary Index (NOPI) Table ?
10.What are allowed on No Primary Index (NOPI) Table?
11.NO Primary Index NOPI – Loading Theory

What is Teradata NO PRIMARY INDEX (NOPI) Table?

The rows of a Teradata NOPI table are not distributed evenly across all AMPs using the hashing algorithm, as is the case with a primary index.

Instead of defining PRIMARY INDEX we defined NO PRIMARY INDEX while creating table, than that tables formed as NO PRIMARY INDEX (NOPI).

EXAMPLE:

This is the syntax:
CREATE TABLE database_name.Table_Name
(
Customer_ID BIGINT NOT NULL
) NO PRIMARY INDEX;

Teradata NoPI example: Emp_Intl table rows spread across AMPs, causing a full table scan on SELECT

How’s row distributed in AMP for No PRIMARY INDEX (NOPI) table?

For a NOPI table, a full table scan is always necessary if there is no other index that can be used.

To identify the rows in the AMP, a ROWID is needed which we get by Hashing alogrithm.

While for PI tables, this is composed of the ROWHASH and a UNIQUENESS value, For NOPI tables, the hash bucket of the AMP and a UNIQUENESS value is used to form the ROWID.

How it can be determine which AMP gets which No PRIMARY INDEX (NOPI) row?

  • A random generator is used. This is available on the AMPs as well as on the parsing engines.
  • During fast load, the random generator of the AMPs distributes the rows in the round-robin procedure.
  • For SQL requests, the DBQL Query Id of the request is used to generate a hash value which is used to distribute the rows.

What will happen if we don’t define the Primary Index in the DDL statement while CREATING TABLE?

CREATE TABLE database_name.Table_Name
(
Customer_ID BIGINT NOT NULL
) NO PRIMARY INDEX;

  • The type of table is created depends on a system setting. If the DBC Control Field is set to “P” or “D” in the settings, a Primary Index Table is created.
  • In this case, the first NOT NULL column of the table definition is used as PRIMARY INDEX (if all columns are NOT NULL, the first NULLable column is used as PRIMARY INDEX).
  • If the DBC Control Field “PrimaryIndexDefault” is set to “N”, a NOPI table is created.

Why create a table with No Primary Index (NOPI)?

NOPI tables are designed to be staging tables. Data from a Mainframe or server can be loaded onto Teradata quickly with perfect distribution. Then, an INSERT/ SELECT can be done to move the data from the staging table (on Teradata) to the production table (also on Teradata). The data can be transformed in staging, and there are no Load Restrictions with an INSERT/ SELECT. A NoPI table usually isn’t queried, but can be!

Diagram of mainframe file loaded into a NoPI staging table on each AMP, then INSERT/SELECT into production

How do Teradata NOPI tables affect query performance?

As we know no access path via hashing exists, all queries against a NOPI table require a full table scan. So to improve query performance we can create a unique secondary index (USI) or a join index.

No Primary Index (NOPI ) tables can be skewed or not?

NOPI tables can be skewed in specific cases.

If a small table is loaded with a fast load, skew can occurs because the data is not sent to the AMPs row by row All rows may be sent to the same AMP and one data block.

When executing an “INSERT…SELECT” statement, from a primary index table into a NOPI table, AMP-local copying of the rows will be applied. All rows stay on their current AMP, and if the primary index table is skewed, the NOPI table will be skewed.

Skew can be avoided by using the HASH BY RANDOM option; data blocks are distributed randomly, which results in an even distribution.

INSERT INTO Database_name.Table_name SELECT * FROM Database_name.Table_name _2020
HASH BY RANDOM;

If you want to distribute on row level to achieve even better randomness, you can use this statement:

INSERT INTO Database_name.Table_name SELECT * FROM Database_name.Table_name _2020
HASH BY RANDOM (1,100000000);

How to find Teradata No Primary Index (NOPI) tables?

The Teradata tablekind for NOPI tables is ‘O’. With the following SQL statement, we can find all NOPI tables in our system:

SELECT * FROM DBC.TABLESV WHERE TABLEKIND = ‘O’;

What are the Limitations Teradata No Primary Index (NOPI) Table ?

  • No SET tables allowed
  • No Identity columns allowed
  • No Row-Level Partitioning allowed
  • No UPDATE, MERGE INTO, or UPSERT allowed
  • No Permanent Journaling possible
  • No UPDATE triggers allowed
  • No Hash Index allowed
  • No Multiload, as its load algorithm depends on the PI

What are allowed on Teradata No Primary Index (NOPI) Table ?

  • Fallback protection
  • Secondary Indexes (USI and NUSI)
  • Join Indexes
  • CHECK and UNIQUE constraints
  • Triggers
  • COLLECT STATISTICS
  • Global Temporary Tables
  • Volatile Tables
  • CLOB and BLOB Data Types
  • Fastload but duplicates are not filtered

NO Primary Index NOPI – Loading Theory

  • INSERT INTO Database_name.Table_name VALUES (100,’Rohan’, ‘Susan’);

    The parsing engine random generator selects a random AMP and appends the row to the end of the Teradata NOPI table.

  • INSERT INTO Database_name.Table_name SELECT * FROM Database_name.Table_name_2020;

    If Database_name.Table_name_2020 is a PI table, the rows will not be redistributed but stay on the same AMP. Skewing is possible!

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
MotoShare.in is your go-to platform for adventure and exploration. Rent premium bikes for epic journeys or simple scooters for your daily errands—all with the MotoShare.in advantage of affordability and ease.

Related Posts

Top 5 Data Integration Platforms in 2027

Picking a data integration platform used to come down to one question: spreadsheet tool or warehouse pipeline? In 2027, that’s no longer the real dividing line. The…

Read More

Head of Data Engineering: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The Head of Data Engineering is the senior leader accountable for building and operating the organization’s data engineering capability: the platforms, pipelines, governance mechanisms, and teams that turn operational data into trusted, secure, and scalable data products. This role owns the data engineering strategy and execution across ingestion, transformation, orchestration, storage, quality, and reliability—enabling analytics, reporting, experimentation, and machine learning.

Read More

Staff Data Platform Engineer: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The **Staff Data Platform Engineer** is a senior individual contributor who designs, builds, and operates the shared data platform capabilities that enable reliable analytics, data products, and ML workloads at scale. This role combines deep hands-on engineering with architectural leadership—owning critical platform components (ingestion, storage, compute, orchestration, governance, and observability) and setting technical direction across multiple teams.

Read More

Staff Analytics Engineer: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The Staff Analytics Engineer designs, builds, and governs the organization’s trusted analytics data foundation—turning raw operational data into well-modeled, well-documented, and high-quality datasets and metrics that power decision-making, experimentation, and customer/product insights. This role sits at the intersection of data engineering and analytics, with a staff-level mandate to define standards, uplift the analytics engineering practice, and reduce friction from “data creation” to “data consumption.”

Read More

Senior Data Platform Engineer: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The **Senior Data Platform Engineer** designs, builds, and operates the core data platform that enables trusted, secure, scalable analytics and data products across the organization. This role focuses on the platform capabilities—ingestion, storage, processing, orchestration, governance, and observability—so that data engineers, analysts, data scientists, and product teams can reliably deliver business outcomes with minimal friction.

Read More

Principal Business Intelligence Engineer: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The **Principal Business Intelligence Engineer** is a senior individual contributor responsible for designing, building, and governing the enterprise BI ecosystem—spanning semantic models, metrics definitions, dashboards, analytics enablement, and performance/reliability of BI delivery. This role translates complex business questions into trusted, scalable analytics products while setting technical direction and standards for BI engineering across the Data & Analytics organization.

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x