Added index to AttributeTypes.pkgID for where clause + order by atID