Monday, April 15, 2013

Can you compress a column which is already present in table using ALTER?

Can you compress a column  which is already present in table using ALTER?

No,   We cannot use ALTER command to compress the existing columns in the table.
A new table structure has to be created which includes the Compression values and data should be inserted into Compress column table.

Please note - ALTER can be used only to add new columns with compression values to table.

3 comments:

  1. Hi Vinay It is possible to add compression to already existing field. I am checked following test case on 14.10, But as of my knowledge this is allowed prior to 14.10 it self.


    ct tb01(i int,j int);

    *** Table has been created.
    *** Total elapsed time was 1 second.

    ins tb01(10,20);

    *** Insert completed. One row added.
    *** Total elapsed time was 1 second.

    alter table tb01 add j compress(1,2);

    *** Table has been modified.
    *** Total elapsed time was 1 second.


    BTEQ -- Enter your SQL request or BTEQ command:
    show table tb01;

    show table tb01;

    *** Text of DDL statement returned.
    *** Total elapsed time was 1 second.

    ---------------------------------------------------------------------------
    CREATE SET TABLE TEST.tb01 ,NO FALLBACK ,
    NO BEFORE JOURNAL,
    NO AFTER JOURNAL,
    CHECKSUM = DEFAULT,
    DEFAULT MERGEBLOCKRATIO
    (
    i INTEGER,
    j INTEGER COMPRESS (1 ,2 ))
    PRIMARY INDEX ( i );

    ReplyDelete
  2. Hello, this weekend is good for me, since this time i am reading this enormous informative article here at my home. compress jpeg to 50kb

    ReplyDelete
  3. Great article with excellent idea!Thank you for such a valuable article. I really appreciate for this great information.. buy likes ig

    ReplyDelete