Subject profiling a (fairly large) SQL application
Author Peppe Polpo
I began writing a few SPs and in the end I got a full-fledged
application written in SQL.

The user sends 3 parameters to the FB database and - after many
minutes - gets the processed data.

(From this experience I understood a litle better what's the use of 3-
tiers applications, but this is a different matter).

Now here am I: a fairly large application written in SQL, that, after
a time consuming debugging, works - or apparently works :) - the way
it should.

The last remaining step is to profile the application, as the answer
time is rather slow.

I devised the following idea:

1. get the system time at the beginning of every SP
2. get the system time at the end of every SP
3. calculate the difference and store the SP name and the elapsed
time in a profile table

In the end, the profile table can give:
1. the SPs that are called most
2. the SPs that steal most of the time

hopefully both kinds can be rewritten so to be faster.

The task is not easy, as the number of SPs is large and there can be
several exit points in a SP to handle.

If you have better ideas, I have big ears.

Best regards

Peppe Polpo