
David Beavon (Software) asked a question.
I have a question about query plans in the SQL engine. I had asked a Progress consultant long ago (10 years?) and got a response that was useful to me at the time, but it was never written down or posted to the Internet. So I need to revisit again...
What are the requirements to execute a query that is ONLY resolved from index data, (while avoiding the base table)? In ABL I think it is virtually impossible to write such queries. But in the SQL engine I know there are some scenarios where it happens (albeit the scenarios aren't as common as when using other modern query engines ).
Would such a plan be possible if ALL my columns are present in the index? Is there any chance I can get also get the ROWID as a bonus, without reaching back to the base table for that?
I vaguely remember the answer I got a decade ago. At that time I was told that any query plans using SQL engine almost always hit the base table. This behavior was only avoided for columns that are numeric and have fixed widths. I think character fields were off-limits for index-only query plans. I think the reasoning was because Progress had some super-special storage mechanisms for character data. (It is also possible that those were the days of "abbreviated indexes", which may not have been compatible with the SQL query engine).
I'm not 100% certain about this, but I think another prerequisite for these sorts of query plans is that we can't use any isolation level other than READ UNCOMMITTED.
I would appreciate some guidance in how we might write index-only queries for the SQL engine. I will end up reviewing my query plans (sql_qplan) to verify the behavior no matter what. But it would be helpful to discuss here, so that I will have a point-of-reference. Then I will be able to refer to this discussion when I'm revisiting this topic again after another ten years .
I opened a tech support case, and got a reply.
"
Our development team has confirmed that it is not possible to fetch the data directly from the index.
"
... so apparently the information that I received from a Progress consultant ten years ago was not correct.
Hope this helps others.