Go Back
2 Votes

Add function to DBG_SELECT_INTERNAL


Would like to see an option added to DBG_SELECT_INTERNAL that will throw an exception anytime a non-optimized key is used in a select.  This would help us in development find problem areas.  Currently the log file shows a non-optimized key was used which resulted in a full table scan.

[Select debugging at GetContractByCustomerLoc:235]
Implicit key selection via optimization: (See LRM)
   Key: Ordered nodup contig segs/Nodup contig segs/Ordered contig segs/Contig segs/Contig size
    >0: 0  0  0  0  0
     1: 0  0  0  0  0
From(FMCON.ISM)
Where(A(5:6).EQS."DAVDON")
Non-optimized table scan: ordered by key 0
[Select debugging at GetContractByCustomerLoc:235]
Total rows fetched: 976 out of 976 (0 selected)

Fixing the where optimized the select
[Select debugging at GetContractByCustomerLoc:235]
Implicit key selection via optimization: (See LRM)
   Key: Ordered nodup contig segs/Nodup contig segs/Ordered contig segs/Contig segs/Contig size
    >0: 0  0  0  1  10
     1: 0  0  0  1  10
From(FMCON.ISM)
Where(A(1:10).EQS."A000DAVDON")
Optimized key: 0 (1:19)
Head key length: 10
Key range: 1:10
Tail exit condition: (1:10)EQS
[Select debugging at GetContractByCustomerLoc:235]
Total rows fetched: 0 out of 976 (0 selected)

But it required us to search 1000's of lines of the log file to find this.  Having it throw an exception and setting Visual Studio to break on all exceptions would have pointed this out sooner.

0 Comments | Posted by Nate Bahl to Synergy .NET on 1/19/2021 7:47 PM
Please log in to comment on this idea.