Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Table partitioning on TIMESTAMP(3) in Teradata 13 - response (6) by SANJI

$
0
0
CREATE TABLE SSURI.PPI_TEST (TRACKINGNUM INTEGER, AUD_TIME TIMESTAMP) PRIMARY INDEX PPI_TEST_PR (TRACKINGNUM) PARTITION BY RANGE_N(CAST((AUD_TIME) AS DATE AT LOCAL) BETWEEN '2009-12-31' AND '2013-12-31' EACH INTERVAL '1' DAY); INSERT INTO SSURI.PPI_TEST SELECT CDTRK#, AUD_TIME FROM SSURI.CUSLDSFL_SI SAMPLE 0.05 WHERE CAST(AUD_TIME AS DATE) BETWEEN '2009-12-31' AND '2013-12-31' COLLECT STATS SSURI.PPI_TEST COLUMN PARTITION; COLLECT STATS SSURI.PPI_TEST COLUMN AUD_TIME; COLLECT STATS SSURI.PPI_TEST COLUMN TRACKINGNUM; SELECT TOP 10 PARTITION, CAST(AUD_TIME AS DATE), COUNT(*) FROM SSURI.PPI_TEST GROUP BY 1,2 ORDER BY 1 PARTITION    AUD_TIME    Count(*) ---------------------------------------- 3    1/2/2010    596 4    1/3/2010    3072 5    1/4/2010    45956 6    1/5/2010    32130 7    1/6/2010    32571 8    1/7/2010    28969 9    1/8/2010    26795 10    1/9/2010    2275 11    1/10/2010    1734 12    1/11/2010    38274   SELECT * FROM SSURI.PPI_TEST WHERE AUD_TIME BETWEEN CAST(DATE '2009-12-31' AS TIMESTAMP) AND CAST(DATE '2010-12-31'  AS TIMESTAMP);   3) We DO an ALL-AMPs RETRIEVE step FROM 366 partitions OF      SSURI.PPI_TEST WITH a CONDITION OF ("(SSURI.PPI_TEST.AUD_TIME <=      TIMESTAMP '2010-12-31 00:00:00.000000') AND      (SSURI.PPI_TEST.AUD_TIME >= TIMESTAMP '2009-12-31      00:00:00.000000')") INTO SPOOL 1 (group_amps), which IS built      locally ON the AMPs.  The SIZE OF SPOOL 1 IS estimated WITH HIGH      confidence TO be 10,061,272 ROWS (513,124,872 BYTES).  The      estimated TIME FOR this step IS 0.18 seconds. The behaviour can be best described as weird.. but it works. Sanjeev

Viewing all articles
Browse latest Browse all 27759

Trending Articles



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