KHRES-309 #comment continue to optimize sql queries and add indexes