Re: Usage Statistics
Posted in 1994
> > One thing I like to do is to imbed a debugging flag in programs that > turns on "set explain on". When you run the program with the flag, the > sqlexplain.out file tells you exactly which tables get hit, how the > optimizer is using the indexes, and most importantly, how often each > SQL statement executes. Especially if the SQL is deep inside an ESQL/C > program, inside of lots and lots of loops, you can find that you are > thrashing a disk to death when you could be hitting it once by reworking > the code. > We have an inhouse tool we call PRESQL, that, amoung many other wonderful things, embeds sql profiler tracing code, that we turn on and off with environment parameters. At assigned intervals, or when a program stops, a unix-profile looking report will be generated. It sort lines of code, based on usage time in the program. Personally, I can't imagine how people can live without this sort of tool. We find it invaluable. Sample output: Time %Time Cum % #Exec Avg_Time Line Type Module 30.73 82.29 82.29 760 0.04 226 U srpconv.p 3.79 10.14 92.44 761 0.00 164 F srpconv.p 1.64 4.39 96.83 760 0.00 235 C srpconv.p 1.04 2.78 99.62 760 0.00 217 B srpconv.p 0.14 0.37 100.00 1 0.14 140 O srpconv.p 0.00 0.00 100.00 1 0.00 193 c srpconv.p Total Seconds = 37.34 -- Naomi Walker (aka N7FSA) | naomi@anasazi.com | Phoenix, Arizona ----------------------------------------------------------------- Dyslexsics, Untie! | Visualize Whirled Peas