#1887 rewrite tracking summary update query

Move p.name to the left side of equation, and use regexp instead of `LIKE`, so query can use `package_name_key` index.