Specifying or altering distribution and organizing keys

You can specify distribution or organizing keys for accelerated tables. Distribution keys distribute data across multiple nodes, and organizing keys sort table rows into blocks. Applying these keys to your tables can improve query response times.

Procedure

To specify or alter distribution and organizing keys:

  1. On the DB2 Administration Menu (ADB2) panel, specify option Z, and press Enter.
  2. On the System Administration (ADB2Z) panel, specify option AT, and press Enter.
  3. Optional: On the DB2 Display/Manage Accelerated Tables (ADBPZMAT) panel. specify selection criteria to filter the tables that you want to display.
  4. Specify option 1, and press Enter.
  5. On the Display Accelerated Tables (ADBPZAT) panel, specify KEYS next to the name of the table for which you want to specify a distribution or organizing key, and press Enter.
    ADBPZAT n ----------- DB2A Display Accelerated Tables -------- Row 1 to 1 of 1 
    Command ===>                                                  Scroll ===> PAGE 
                                                                                   
    Commands: RTS  ADD  LOAD  ENABLE  DISABLE  BET  DET  DEL  DISPOPT  DISPINFO
    Line commands:                                                                 
      I - Interpret  AC - Accelerator  T - Table  RTS - RTS info  L - Load         
     AR - Archive  EN - Enable  DI - Disable  DEL - Delete  DET - Table details     
     ? - Show all line commands                                                    
                                                                                   
         Table             Table    Server       Remote   Remote                   
    Sel  Name              Schema   Name     E A Name     Schema   Refresh Time    
          *                 *        *        * * *        *        *               
    ---- ----------------- -------- -------- - - -------> -------- --------------->
         TB1               SYSADM   AC2      Y   TB1-ID_4 SYSADM   2015-04-07-13.49
    
  6. On the Accelerated Table - Keys (ADBPZAK) panel, specify a line command to indicate the relative position of the column in the distribution or organizing key.
    You can specify any of the following valid values for distribution keys and organizing keys:
    Distribution keys
    D1, D2, D3, and D4.
    Organizing keys
    O1, O2, O3, and O4.
    ADBPZAK   ------ DC1Q Accelerated Table - Keys --------------- Row 1 to 2 of 2  
    Command ===>                                                  Scroll ===> CSR   
                                                                                    
    Commands: SAVE  CANCEL                                                          
                                                                                    
     Status for table . . : SYSADM.T1 
     Accelerator name . . : IDAAZ12                                                                                     
     Acceleration status  : true       Load status : Loaded                         
     Replication status . : false      Details . . :                                
                                                                                    
     Used disk space  . . : 1       (in MB)   Row count . . . . . : 16              
     Skew . . . . . . . . : 1.000   (0 to 1)  Organized percent . : 0.000           
                                                                                    
    Line commands:  Dn - Distribution sequence  On - Organizing sequence            
                     R - Remove column sequence                                     
                                                                                    
    S  Column Name        D O Col Type      Length  Scale Nulls                     
       *                  * * *                  *      * *                         
    -- ------------------ - - -------- ----------- ------ ------                    
       COL1                   INTEGER            4      0 N                         
       COL2                   CHAR              10      0 Y                         
    ******************************* END OF DB2 DATA *******************************
    
  7. Issue the SAVE command to save your changes.