Archives of the TeradataForum
Message Posted: Thu, 16 Mar 2001 @ 03:03:01 GMT
This is more complicated than you might think.
You will find that logging for a single request also covers multiple log times due to the fact that it logs per object invovled in the query as indicated by others. Each access to the dbc rights table causes a row in the access log, and that may take several seconds, depending upon the complexity of the query. Since you are interested in who, how many requests, and when, you will need to group by username, sessionno, logdate, and statementtext as a minimum. You may also need to group by eventcount. Not including logtime may cause you to undercount, but including log time will definitely cause you to over count. The undercounting is because the same person may submit the same query more than once on the same day using the same session. Getting an exact count of queries per person is somewhat difficult due to the multiple logging. If you want to get closer you can take a portion of the logtime and make an assumption that someone won't intentionally issue the same query twice in one minute. Then you can group by logtime (at least a portion of it including hour and minutes). This too can be wrong due to logging across a minute boundary. (1st logged object at 01:01:59 and last at 01:02:01). If you choose to count grouped by statement text per minute you would count this example twice. However, in the long run the number that are double counted as a result of logging across the minute boundary is small, and possibly offset by the number of real queries done twice in the same minute.
So, what should have been a simple exercise in counting, turns out to be a pretty complex thing to do if you are logging on each all.
Hope that didn't confuse more than clarify.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|