CREATE INDEX HPA_IDENT_SEARCH ON IIS.IIS_IDENTIFIER
(
    PERSON_IDENT_TYPE_CODE,
    PERSON_IDENTIFIER_VALUE,
    FK_PERSON_IDENTIFIER
) WITH(ONLINE=ON)

CREATE INDEX HPA_IDENT_LOOKUP ON IIS.IIS_IDENTIFIER
(
    FK_PERSON_IDENTIFIER,
    PERSON_IDENT_TYPE_CODE
)INCLUDE(
    PERSON_IDENTIFIER_VALUE
) WITH(ONLINE=ON)

CREATE INDEX HPA_LOL_SEARCH ON IIS.LOSS_OF_LIBERTY
(
    FK_PERSON_IDENTIFIER,
    INMATE_SURNAME,
    INMATE_FORENAME_1,
    DATE_1ST_RECEP
) INCLUDE (
    INMATE_FORENAME_2,
    INMATE_BIRTH_DATE
) WITH(ONLINE=ON)

CREATE INDEX HPA_KA_SEARCH ON IIS.KNOWN_AS
(
    PERSON_SURNAME,
    PERSON_FORENAME_1,
    PERSON_FORENAME_2,
    PERSON_BIRTH_DATE,
    PERSON_SEX,
    FK_PERSON_IDENTIFIER
) WITH(ONLINE=ON)

CREATE INDEX HPA_IDENT_SEARCH ON IIS.IIS_IDENTIFIER
(
    PERSON_IDENT_TYPE_CODE,
    PERSON_IDENTIFIER_VALUE,
    FK_PERSON_IDENTIFIER
) WITH(ONLINE=ON)

CREATE INDEX HPA_IDENT_LOOKUP ON IIS.IIS_IDENTIFIER
(
    FK_PERSON_IDENTIFIER,
    PERSON_IDENT_TYPE_CODE
)INCLUDE(
    PERSON_IDENTIFIER_VALUE
) WITH(ONLINE=ON)

CREATE INDEX HPA_LOL_SEARCH ON IIS.LOSS_OF_LIBERTY
(
    PK_PRISON_NUMBER,
    FK_PERSON_IDENTIFIER
)INCLUDE(
    DATE_1ST_RECEP,
    INMATE_SURNAME, INMATE_FORENAME_1, INMATE_FORENAME_2,
    INMATE_BIRTH_DATE
)

CREATE INDEX HPA_KA_SEARCH ON IIS.KNOWN_AS
(
    FK_PERSON_IDENTIFIER,
    PERSON_FORENAME_1,
    PERSON_FORENAME_2,
    PERSON_SURNAME,
    PERSON_BIRTH_DATE,
    PERSON_SEX
)

Update indexes for new search routine
Update indexes for new search routine

