Skewed data handling

Database
Vga
Enthusiast

Skewed data handling

How do I handle the skewed data, if I have to have this data with less AMP Cpu time & Less Skew?

Query looks like:

SELECT PT.COL_1, PR.COL_2

FROM TMP_TEST_NEW PT

   , TABLE2 PR

WHERE PT.KN_ID = PR.KN_ID;

There are few values which are highly skewed in PT table (KN_ID column / Secondary Index) above & PR table is created with UPI on KN_ID.

GV

2 REPLIES
Enthusiast

Re: Skewed data handling

Hey GV,

Can you post the ddl for the two tables?

Vga
Enthusiast

Re: Skewed data handling

Here are the DDLs:

CREATE SET VOLATILE TABLE TMP_TEST_NEW ,NO FALLBACK ,

     CHECKSUM = DEFAULT,

     DEFAULT MERGEBLOCKRATIO,

     NO LOG

     (

      OR_DT DATE FORMAT 'YY/MM/DD',

      WT_DT DATE FORMAT 'YY/MM/DD',

      COL_1 BIGINT,

      OR_ITE_ID BIGINT,

      KN_ID BIGINT)

PRIMARY INDEX ( COL_1 ,KN_ID)

ON COMMIT PRESERVE ROWS;

CREATE SET TABLE TABLE2 ,NO FALLBACK ,

     NO BEFORE JOURNAL,

     NO AFTER JOURNAL,

     CHECKSUM = DEFAULT,

     DEFAULT MERGEBLOCKRATIO

     (

      COL_2 INTEGER NOT NULL,

      NATL_NBR INTEGER NOT NULL,

      SLL_FMT INTEGER NOT NULL,

      VP_OVRHD_NBR INTEGER NOT NULL,

      RGN_OVRHD_NBR INTEGER NOT NULL,

      DM_OVRHD_NBR INTEGER NOT NULL,

      KN_ID INTEGER NOT NULL,

      ORG_FAC_NBR SMALLINT NOT NULL,

      FORMAT_TYPE CHAR(3) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL)

PRIMARY INDEX ( KN_ID )

INDEX ( ORG_FAC_NBR );