Hein, have you tried to create composite indexes on those tables that are involved as part of the READ PROTECT query statement? A composite index consists of several attributes in certain order that are chained together to form one index.
I plan to do this when I go to production. As of now, you have to do it outside of Aware and anytime you make a change to DB which aware drops tables, you have to re-create them.
Previously, in ASP.Net, where I had to create my own "READ PROTECT" system, by tenant, adding composite indexes made a huge difference when I was for example looking at invoices for a specific tenant.
I added a new composite index for the invoice that combined <Company_ID> + <Invoice_ID>. Then anytime I was looking for invoices for any company, I'd provide <Company_ID> as part of the first element of my query and I would instantly get invoices (in 10,000,000) test table. But If I would delete that composite index, it would take much longer.
The trick is that, the sequence of elements in the composite index must be organized with the hierarchy of table relations. So, for a "Line item", the composite might be <Company_ID> + <Invoice_ID> + <LineItem_ID>.
Now if you look for item "654" for Company=111 and Invoice 222, you would get instant return.
Hope this helps.