IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_TASK_SCHEDULETYPE') CREATE INDEX IDX_FMM_TASK_SCHEDULETYPE ON T_PMTS_TASK ( FSCHEDULETYPE );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_TASK_STATUS') CREATE INDEX IDX_FMM_TASK_STATUS ON T_PMTS_TASK ( FSTATUS  );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_TASK_VERSIONID') CREATE INDEX IDX_FMM_TASK_VERSIONID ON T_PMTS_TASK ( FVERSIONID  );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_WBS_VERSIONID') CREATE INDEX IDX_FMM_WBS_VERSIONID ON T_PMTS_WBS ( FVERSIONID  );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_TASK_GROUP1') CREATE INDEX IDX_FMM_TASK_GROUP1 ON T_PMTS_TASK ( FPROJECTNUMID,FENABLE,FVERSIONID,FWBSID);

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FMM_TASK_GROUP2') CREATE INDEX IDX_FMM_TASK_GROUP2 ON T_PMTS_TASK ( FDELETESTATUS,FRELEASESTATUS,FWBSID,FPROJECTNUMID,FVERSIONID);