Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Table Partition - forum topic by sharatbalaji

$
0
0

CREATE SET TABLE INFORM_USER.TABLEA ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO
(
PLCY_NBR INTEGER,
MO_ID INTEGER,
PLCY_STATUS VARCHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC
)
PRIMARY INDEX ( PLCY_NBR ,MO_ID )
PARTITION BY RANGE_N(CAST(((CAST((MO_ID ) AS VARCHAR(10) CHARACTER SET LATIN NOT CASESPECIFIC))||'01') AS DATE FORMAT 'YYYYMMDD') BETWEEN DATE '2010-01-01' AND DATE '2090-12-01' EACH INTERVAL '1' MONTH);
 
Explain SEL * FROM INFORM_USER.TABLEA WHERE MO_ID IN (201201,201202)
1) First, we lock a distinct INFORM_USER."pseudo table" for read on a
RowHash to prevent global deadlock for INFORM_USER.TABLEA.
2) Next, we lock INFORM_USER.TABLEA for read.
3) We do an all-AMPs RETRIEVE step from INFORM_USER.TABLEA by way of
an all-rows scan with a condition of ("(INFORM_USER.TABLEA.MO_ID =
201202) OR (INFORM_USER.TABLEA.MO_ID = 201201)") into Spool 1
(group_amps), which is built locally on the AMPs. The size of
Spool 1 is estimated with no confidence to be 6 rows (222 bytes).
The estimated time for this step is 0.02 seconds.
4) Finally, we send out an END TRANSACTION step to all AMPs involved
in processing the request.
-> The contents of Spool 1 are sent back to the user as the result of
statement 1. The total estimated time is 0.02 seconds.
As per the explain plan the query doesn't look in to the 2 partitions but rather looking in to all rows. Why is it so?

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>