/**费用项目表字段FPARENTID建立索引；费用项目关联部门表删除联合索引，并给两个字段 FEXPITEMID 、FRELORGID 分别建立索引**/

-- 费用项目表 FPARENTID 字段建立索引，
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_ER_EXPENSEITEM_PARENTID') CREATE INDEX IX_ER_EXPENSEITEM_PARENTID ON T_ER_EXPENSEITEM ( FPARENTID );

--删除费用项目关联部门表的联合索引IDX_BD_ERDEPT_ORG_EXP
EXEC p_DropIdx 'IDX_BD_ERDEPT_ORG_EXP', 'T_BD_EXPITEMRELDEPT';

--对费用项目关联部门表中的费用项目字段建立索引
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_ERO_EXP') CREATE INDEX IDX_BD_ERO_EXP ON T_BD_EXPITEMRELDEPT ( FEXPITEMID );

--对费用项目关联部门表中的关联部门字段建立索引
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_ERO_ORG') CREATE INDEX IDX_BD_ERO_ORG ON T_BD_EXPITEMRELDEPT ( FRELORGID );

