Skip to content
  • Dan McGee's avatar
    Add multicolumn indexes on votes and notifications tables · e2b3bd1c
    Dan McGee authored and louipc louipc's avatar louipc louipc committed
    
    
    To put a long story short, when we do joins on these tables in our
    pkg_search_page() function, we always join on both the user ID and package
    ID columns. By creating multicolumn indices, we can always get the exact row
    we are looking for in the table.
    
    The benefits of adding a unique index should also speak for themselves, as
    we previously did not have this on either of these tables.
    
    This is part one of a two-part series to address the fact that this query
    was often showing up in our slow query logs.
    
    Signed-off-by: default avatarDan McGee <dan@archlinux.org>
    Signed-off-by: default avatarLoui Chang <louipc.ist@gmail.com>
    e2b3bd1c