Progress RDBMS index issues - for information

Discussão em 'StackOverflow' iniciado por fdantas, Novembro 28, 2015.

  1. fdantas

    fdantas Administrator Moderador

    I have found out that in Progress 10.1 when multiple indexes are used in a query the database will use the first index in the list of indexes and not the most optimal and not a subset of the two indexes.

    Did anyone else experience this?

    =================================================================

    Several indexes are defined but the two we are looking at are: XIE1cac_role_person owning_entity_mnemonic owning_entity_key role_key

    XIE2cac_role_person contract_obj person_role_code effective_from_date

    Initially my code was as follow, and it was using the first index which returns a much larger dataset.:

    FOR EACH cac_role_person NO-LOCK
    WHERE cac_role_person.contract_obj = cbm_contract.contract_obj
    AND cac_role_person.owning_entity_mnemonic = "BROKER"
    AND (
    (cac_role_person.effective_to_date > TODAY
    AND cac_role_person.effective_to_date >=
    cbm_contract_component.contract_component_start_date)
    OR (cac_role_person.effective_to_date = ?
    AND cac_role_person.effective_from_date <=
    cbm_contract_component.contract_component_start_date)
    ):


    So I now force it to use the 2nd Index:

    FOR EACH cac_role_person NO-LOCK USE-INDEX XIE2cac_role_person
    WHERE cac_role_person.contract_obj = cbm_contract.contract_obj
    AND cac_role_person.owning_entity_mnemonic = "BROKER"
    AND (
    (cac_role_person.effective_to_date > TODAY
    AND cac_role_person.effective_to_date >=
    cbm_contract_component.contract_component_start_date)
    OR (cac_role_person.effective_to_date = ?
    AND cac_role_person.effective_from_date <=
    cbm_contract_component.contract_component_start_date)
    ):


    The first code resulted in about 4 000 fixes in 30 hours and the improvement resulted in 70 000 fixes in 12 hours. (the loop is part of much bigger piece, but this was only change i needed to speed up processing 17 times

    Continue reading...

Compartilhe esta Página