•  
      request #12471 Add missing index on ugroup_user
    Infos
    #12471
    Marie Ange Garnier (marieange)
    2018-10-31 17:00
    2018-10-30 13:34
    13180
    Details
    Add missing index on ugroup_user

    The following query does not always use index of primary key on user_group table:

    SELECT ug.*
    FROM ugroup_user AS ug_u
           INNER JOIN user USING (user_id)
           INNER JOIN ugroup AS ug USING (ugroup_id)
           INNER JOIN groups AS g USING (group_id)
           LEFT JOIN user_group USING (group_id, user_id)
           INNER JOIN forgeconfig ON (forgeconfig.name = 'access_mode')
    WHERE ug_u.user_id = '10430' AND (
        (
            forgeconfig.value = 'restricted'
              AND
            (
                user_group.group_id IS NOT NULL
                  OR
                user.status = 'A' AND g.access IN ('public', 'unrestricted')
                  OR
                user.status = 'R' AND g.access = 'unrestricted'
                )
            )
          OR
        (
            forgeconfig.value <> 'restricted'AND
            (
                user_group.group_id IS NOT NULL OR g.access <> ('private')
                )
            )
        );

     

     

    Other
    All
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Marie Ange Garnier (marieange)
    Closed
    2018-10-31
    Attachments
    Empty
    References
    Referencing request #12471
    Referenced by request #12471

    Artifact Tracker v5

    rel #12268 10.7

    Follow-ups

    User avatar
    • Original Submission
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes