Added index to AttributeKeyCategories.akHandle for where clause. From what I could tell this could possibly be made a unique index based on looking at the other queries don't include the pkgID with this. But probably an issue for another day.

Added index to AttributeKeyCategories.pkgID for where clause and where clause with order by on Category ID