Confusing INDEX selection and XREF information...

mbraun

New Member
Hi there!

I´m a little bit confused about a little database query which
looks like this:

for each jp where jp.jid > "" and jp.jp_lnr = "700M4" no-lock:
display.....
end.

There´s an index on this table which conains both
fields "jp.jid" and "jp.jp_lnr". Instead of using this index
Progress chooses the index "lnr-lg-lbl-wa", which has
"jp_lnr" as the first component but doesnt contain "jid"
at all. I´m aware of the rules Progress uses to choose
the index (equality, range, etc.) but isn´t that a weird
behaviour?

Down there´s the XREF output. What confuses my there is
that the String "lnr-lg-lbl-wa" appears which isn´t
in the sourcecode. Maybe somebody who has grown up
with Progress can explain that to me too...

c:\temp\euromaus.p c:\temp\euromaus.p 1 COMPILE c:\temp\euromaus.p
c:\temp\euromaus.p c:\temp\euromaus.p 1 CPINTERNAL iso8859-1
c:\temp\euromaus.p c:\temp\euromaus.p 1 CPSTREAM iso8859-1
c:\temp\euromaus.p c:\temp\euromaus.p 1 STRING "jp" 2 NONE UNTRANSLATABLE
c:\temp\euromaus.p c:\temp\euromaus.p 1 ACCESS magware.jp jid
c:\temp\euromaus.p c:\temp\euromaus.p 1 ACCESS magware.jp jp_lnr
c:\temp\euromaus.p c:\temp\euromaus.p 1 STRING "700M4" 5 NONE TRANSLATABLE
c:\temp\euromaus.p c:\temp\euromaus.p 1 SEARCH magware.jp lnr-lg-lbl-wa
c:\temp\euromaus.p c:\temp\euromaus.p 4 STRING "lnr-lg-lbl-wa" 13 NONE UNTRANSLATABLE


Thanks for your brains!

Marc
 
Marc,
Progress works on equality matches not greater thans.

If I asked you to find entries in a phone box where the surname started with a letter after "B" and the initial was "M", you'd have to look through nearly the whole book. So it is with Progress indexes.

If you change your query to
for each jp where jp.jid = "" and jp.jp_lnr = "700M4" no-lock:
display.....
end.
and check the XREF, I'm sure you'd see Progress using the index you'd expect.

Although you haven't specified which index to use, Progress decides at run time and displays it in the XREF code. That it why it appears there, but not in the source code.
 
Top