Hi all
I have a rather large table that and i want to use as many indexes i can in order to get performance.
I have the following indexes:
-iClosecode
-iGroupName
-iFromDateTime
-iToDateTime
if i use:
def var dtStart as datetime no-undo.
def var dtEnd as datetime no-undo.
assign dtStart = datetime(6,1,2015,8,0,0)
dtEnd = datetime(6,8,2015,16,0,0).
for each xx no-lock
where xx.CloseCode = 1
and xx.GroupName = "Oslo"
and xx.StartTime >= dtStart
and xx.EndTime <= dtEnd:
end.
if i compile this with xref i can see from the output that it only uses the inexes "iCloseCode" and "iGroupName".
If i change ">=" and "<=" to just "=" and compiles again with xref, i can see that progress now uses all indexes.
Is there a way to get progress to use all 4 indexes if i use >= and <= ? Can i set progress to use all indexes with "use-index" of any kind ?
Would this worked better if i created one index with all four fields ?
I have a rather large table that and i want to use as many indexes i can in order to get performance.
I have the following indexes:
-iClosecode
-iGroupName
-iFromDateTime
-iToDateTime
if i use:
def var dtStart as datetime no-undo.
def var dtEnd as datetime no-undo.
assign dtStart = datetime(6,1,2015,8,0,0)
dtEnd = datetime(6,8,2015,16,0,0).
for each xx no-lock
where xx.CloseCode = 1
and xx.GroupName = "Oslo"
and xx.StartTime >= dtStart
and xx.EndTime <= dtEnd:
end.
if i compile this with xref i can see from the output that it only uses the inexes "iCloseCode" and "iGroupName".
If i change ">=" and "<=" to just "=" and compiles again with xref, i can see that progress now uses all indexes.
Is there a way to get progress to use all 4 indexes if i use >= and <= ? Can i set progress to use all indexes with "use-index" of any kind ?
Would this worked better if i created one index with all four fields ?