It would help us developers so much if Mendix would indeed specify where those warnings are coming from. There are some hints though.
Now optimizing is always tricky. You probably need to focus on your XPaths in the entity access. Try always to put the constrained that limits the most at the top.
XPath constrains that have the contains function in them are heavy on the database. You should try to avoid those if possible. Starts-with is much less heavy and might also do the trick.
Examine your XPaths and make sure that the stuff you use also has an index on it. For instance when checking a date greater then etc. make sure that date field has the right index (ascending or descending).
Try to measure your different XPath to check if they are indeed faster. You can use the timer functions from the community commons for that. It is not ideal but better then nothing. I create test microflow to measure this. And use this before and after you set an index on an attribute to see what works best.
And you could try to set your loglevel DataStorage_QueryPlan to trace. That gives you a lot of info.
But It would be so nice if I could right click a retrieve action in a microflow and measure that retrieve on my current local database. That would helps us developers so much.
Regards,
Ronald