XREF and temp-tables

Stefan

Well-Known Member
Windows 7 x64 with 10.2B04 32-bit (also verified with 9.1E04 on Windows 2003 32-bit).

I have seen a few posts on ProgressTalk with references to unexpected behavior of XREF in combination with temp-tables. Today I wanted to see the index selection being used and to my surprise nothing that is happening with the temp-table is being logged by XREF.

Code:
DEFINE TEMP-TABLE tt
   FIELD cc AS CHAR
   FIELD dd AS INT
   INDEX tt1ix IS UNIQUE PRIMARY cc
   INDEX tt2ix dd.


FOR EACH tt WHERE tt.dd = 0:
   MESSAGE tt.cc.
END.

This is then xref'ed with:

Code:
COMPILE c:/temp/tt.p XREF c:/temp/tt.txt.

The xref output then contains no reference whatsoever to the temp-table:

Code:
c:\temp\tt.p c:\temp\tt.p 1 COMPILE c:/temp/tt.p
c:\temp\tt.p c:\temp\tt.p 1 CPINTERNAL ISO8859-1
c:\temp\tt.p c:\temp\tt.p 1 CPSTREAM ISO8859-1
c:\temp\tt.p c:\temp\tt.p 1 STRING "tt" 2 NONE UNTRANSLATABLE 
c:\temp\tt.p c:\temp\tt.p 1 STRING "cc" 2 NONE UNTRANSLATABLE 
c:\temp\tt.p c:\temp\tt.p 1 STRING "dd" 2 NONE UNTRANSLATABLE 
c:\temp\tt.p c:\temp\tt.p 9 STRING "tt1ix" 5 NONE UNTRANSLATABLE 
c:\temp\tt.p c:\temp\tt.p 9 STRING "tt2ix" 5 NONE UNTRANSLATABLE

Is this expected? This example is of course a no-brainer, but I really would like some more information on indexes being used in large temp-tables without guessing the index being used.

As a work-around I can create a dynamic query and grab the INDEX-INFORMATION, but I was rather surprised in the lack of XREF information on static temp-table usage.
 

GregTomkins

Active Member
I'm not answering directly but I have had similar thoughts about the lack of TT information in VST's and PROMON. We have sometimes had major performance problems arising from TT's and there seemed to be no way to debug them outside of adding code to the application to directly test the TT impact... always some guessing involved.
 

tamhas

ProgressTalk.com Sponsor
Don't know about the XREF, but 11.0 will have VST support for TT usage which should help in diagnosis.
 

Stefan

Well-Known Member
Stefan Houtzager just pm'ed me, if you add NEW SHARED to the temp-table then the index used does show in the xref output. Weird...
 

Stefan

Well-Known Member
I just couldn't bring myself to type 'new shared'! Bah, I've just done it! Going to have to iron my hands now as punishment.

:) Just throw away the offending keyboard that allowed you to enter it, maybe go the whole way and throw out the computer for accepting this kind of input from the keyboard.
 
Top