Ускорение режима все партии

Материал из wiki.standart-n.ru
Перейти к: навигация, поиск

I вариант

/******************************************************************************/
/***               Generated by IBExpert 07.03.2016 15:48:01                ***/
/******************************************************************************/

/******************************************************************************/
/***      Following SET SQL DIALECT is just for the Database Comparer       ***/
/******************************************************************************/
SET SQL DIALECT 3;



/******************************************************************************/
/***                                 Tables                                 ***/
/******************************************************************************/



CREATE TABLE WAREBASEPARTS (
    PART_ID         DM_ID NOT NULL /* DM_ID = BIGINT */,
    WARE_ID         DM_UUID NOT NULL /* DM_UUID = CHAR(36) NOT NULL */,
    SNAME           DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    SIZG            DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    SCOUNTRY        DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    ORIG_CODE       DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    SORIG_NAME      DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    SORIG_IZG       DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    SORIG_COUNTRY   DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    BCODE_IZG       DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    PRICE           DM_DOUBLE /* DM_DOUBLE = DOUBLE PRECISION */,
    PRICE_O         DM_DOUBLE /* DM_DOUBLE = DOUBLE PRECISION */,
    PRICE_Z         DM_DOUBLE /* DM_DOUBLE = DOUBLE PRECISION */,
    PRICE_R         DM_DOUBLE /* DM_DOUBLE = DOUBLE PRECISION */,
    QUANT           DM_DOUBLE /* DM_DOUBLE = DOUBLE PRECISION */,
    BARCODE         DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    BARCODE1        DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    DEP             DM_ID /* DM_ID = BIGINT */,
    KRITK           DM_ID /* DM_ID = BIGINT */,
    GODENDO         DM_DATETIME /* DM_DATETIME = TIMESTAMP */,
    SERIA           DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    SUM_NDSO        DM_DOUBLE /* DM_DOUBLE = DOUBLE PRECISION */,
    SERT            DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    DATESERT        DM_DATETIME /* DM_DATETIME = TIMESTAMP */,
    KEMVSERT        DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    SDSERT          DM_DATETIME /* DM_DATETIME = TIMESTAMP */,
    REGN            DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    NGTD            DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    EDIZM           DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    DOC_ID          DM_ID /* DM_ID = BIGINT */,
    DOCNUM          DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    DOCDATE         DM_DATETIME /* DM_DATETIME = TIMESTAMP */,
    DOCCAPTION      DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    DOCAGENT        DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    DOCVNUM         DM_ID /* DM_ID = BIGINT */,
    DOCVSHIFT       DM_ID /* DM_ID = BIGINT */,
    INSERTDT        DM_DATETIME /* DM_DATETIME = TIMESTAMP */,
    UPDATEDT        DM_DATETIME /* DM_DATETIME = TIMESTAMP */,
    ENDDT           DM_DATETIME /* DM_DATETIME = TIMESTAMP */,
    NDS             DM_DOUBLE /* DM_DOUBLE = DOUBLE PRECISION */,
    REALQUANT       DM_DOUBLE /* DM_DOUBLE = DOUBLE PRECISION */,
    PART_PARENT_ID  DM_ID /* DM_ID = BIGINT */,
    NAME_ID         DM_UUID NOT NULL /* DM_UUID = CHAR(36) NOT NULL */,
    IZG_ID          DM_UUID NOT NULL /* DM_UUID = CHAR(36) NOT NULL */,
    COUNTRY_ID      DM_UUID NOT NULL /* DM_UUID = CHAR(36) NOT NULL */,
    NAC             DM_DOUBLE /* DM_DOUBLE = DOUBLE PRECISION */,
    BLOCK_QUANT     DM_DOUBLE /* DM_DOUBLE = DOUBLE PRECISION */,
    BLOCK_COUNT     DM_STATUS /* DM_STATUS = INTEGER */,
    MMBSH           DM_TEXT1024 /* DM_TEXT1024 = VARCHAR(1024) */,
    PART_TYPE       DM_STATUS /* DM_STATUS = INTEGER */,
    BASE_AGENT_ID   DM_ID /* DM_ID = BIGINT */,
    SBASE_AGENT_ID  DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    CONTRACT_ID     DM_ID /* DM_ID = BIGINT */,
    SCONTRACT_ID    DM_TEXT /* DM_TEXT = VARCHAR(250) */,
    GROUP_ID        DM_ID /* DM_ID = BIGINT */,
    ISFOLDER        DM_STATUS /* DM_STATUS = INTEGER */,
    MNN             DM_TEXT /* DM_TEXT = VARCHAR(250) */
);




/******************************************************************************/
/***                              Primary Keys                              ***/
/******************************************************************************/

ALTER TABLE WAREBASEPARTS ADD CONSTRAINT PK_WAREBASEPARTS PRIMARY KEY (PART_ID);


/******************************************************************************/
/***                               Privileges                               ***/
/******************************************************************************/