Front-end query runtime data

Because of this task was urged. It's been about two months.
But since I have been on vacation recently, I haven't had time to do it yet.

Today, everyone went on vacation, so let me summarize a little bit.
Keywords: BW statistics/query runtime/statistics the importance of query in the BW system, and the frequency of use. Retire the query that is not used, and the query that Top N is used.

The above keywords are easy to find later. . .

The focus of this article is: Who is the user. . Which queries are used

In fact, my master taught me this before, but it is not what it used to be. He taught me that skill. I was really just getting started and didn't understand anything. He told me all of his big tricks, aggregation and optimization.
However, the time has passed, and the gatherings at this time have been directly abandoned by HANA.
And he told me to use SAP's own Content. But I don't know if this thing is installed in our system. I did not use this method today.

Assuming that BI Content is not installed, where do you know who used which query? In a certain period of time, which query is used the most (Top N)?

Use view or table or BI content

The BW system has some tables and views. There are some statistical information. BW content also uses these views.
You can use database tables or predefined views. Or technical content.
The BI Content data source is 0TCT_DSA1 OLAP
cube: 0TCT_CA1 (this is written as a hana optimized infocube, it may read the data of RSDDSTAT_OLAP in real time, I haven't come to study for details)
Insert picture description here
view: RSDDSTAT_OLAP
this view is what I want to use today, source From the table:

RSDDSTATHEADER RSDDSTATINFO
RSDDSTATEVDATA
If
Insert picture description here
you see this situation, you will know it, and you must use a view instead of a table. In fact, this view also contains all the information we need to use related to query runtime.

Turn on statistics switch

If you do not have this real-time data, then you have to check whether this data has been collected. This is in RSDDSTAT: the
Insert picture description here
first step is to select or filter the query you want to count.
The second step is to select setting X. The
third step is to select replace values ​​and turn on the switch.
Then save. I don't know what the default default is, and I don't understand the meaning of this setting. Either close or open. There is a third option I don’t understand. But it seems that default can also collect data.

View content

With the statistics, let's take a look at what information is in this view.
Insert picture description here
Except for the top five unintelligible ID types. We are better to use the circled query, who/when/which info provider to look at.
Then there are two yellow times, one is runtime and the other is event runtime. Which time should be used to count query running time?
This is about to go down and delve into it.

First of all, we don't know what the runtime is, but there is also an event ID in the key, which is definitely related to event time.
Is this Event ID so important?
What is the value?
Insert picture description here

Insert picture description here

This value is quite a lot.
Then why did I circle 3010 and 3100? I'm going to split here. In order to understand the Event ID value, let's first look at what the value in the view looks like. What are the first few Key values?
Insert picture description hereThe first SessionID is an automatically generated one.
The second StepID is also automatically generated.
The third HandleID, arranged in order.
The fourth HandleType, as can be seen from the figure, has no one-to-one relationship with handleID. The specific values ​​are as follows.
Insert picture description here
It can also be seen in the table:
Insert picture description here
Let's observe the figure in the previous example. When HANDLETYPE is OLAP, the corresponding Info Provider and objectname give us the query information. Only the OLAP operation type has the query information we need.
So here we can infer that what we need is HANDELTYPE of OLAP type. (Some of the other types are to open front-end operation tools, input parameters, and connect to data providers, etc. These are not included in the query runtime)

The fifth EventID has many IDs (the corresponding values ​​are on the previous picture), but we don't know what it means.

There is steptype at the back:
Insert picture description here
what do these mean?
Our example is AOE. This is the report that you use which tool to look at.
AOE is Analysis for Office.
AOP Analysis Office Powerpoint

Also in this table: RSDDSTATSTEPTPInsert picture description here

In the example, I circled several times, namely UTIME and CALDAY, and STARTTIME in the last column.
No need to watch this time. That is, the final start time is divided.

Then here, there is still an important time. RUNTIME, it's all the same.
What is he? Look at EVTIME on the right, it turns out to be the total time of EVTIME.

If we only calculate the running time of the query, then the runtime of 399 seconds is completely invalid. We need to first set the operation type to be under the OLAP type. Then find the corresponding Evtime of EventID.

Then this runtime was abandoned by us.

After this chaos.
We came to the conclusion:
what we need is the Handle type is the event time corresponding to the OLAP event ID.
So which event ID is selected under OLAP? Either?

We know that event 3100 (OLAP: Read Data) and
event 3010 (OLAP: Generate Query)
are obviously related to processing query, reading and generating query.

That is to say, under normal circumstances, when I execute a query, there will be two event records, one for reading and one for generating.
Under unusual circumstances, there may be many reads and one generation. Then, at this time, 3010 can only be used as a statistical value for calculating whether the query is executed or not.

Okay, here we come to subdivide the example.
If I just look at the record of the query from the user.
It is assumed that the user can only view the query through Analysis for Office.
Since Analysis is basically a workbook, a workbook can contain many queries.
Let’s take a look at what events are available when the steptype is defined as AOE.

Insert picture description here
As you can see here, through AOE, this user viewed a workbook at a certain time, and there are two queries in this workbook. All events.
Insert picture description here
The train of thought is cleared up here.
I need all OLAP (HANDELTYPE) processing methods to view reports with the AOE (STEPTYPE) tool.
I need to know who it was (UNAME), at what time (CALDAY), and how long it took (EVTIME).

*** At this point, we will proceed to the next question:
eventtime we know that it is used to measure the time of the query.
But this event time has other related event count and eventIDcount, so is this event time the time of a single event id?
Or the overall time?
First of all, there must be a concept of what eventcount and eventid count are.
Insert picture description here
To be honest, I couldn't understand even after reading the explanation.
I only know that the eventID count corresponding to the event id means how many times the event id has been started.
Then I still don't know whether eventtime is the trigger time of a single event ID or the overall time.

Let's consider an example:
at 10:02, the overall runtime is 15709 seconds, and the time used for the event of 12500 is 15704. This is because he has made a mistake in opening the program. It is that his AFO has not been opened. We will exclude this non-report running time.

Insert picture description here

Then there is 5 seconds left.
I don't need to calculate it, it just happens to be the time when all evtimes are added up.

Because if the evtime is a single one, multiply the eventID count, it is far more than 5 seconds.

For the sake of rigor, I still forget it.
It is true.
All eventtimes add up due to rounding to 15710.69

***Concluded that eventtime is a summary of the future value.

Let’s talk about the runtime here. I will see the explanation of the runtime (validity period) just now. Hey, sometimes it’s hard to do if you don’t understand English.

它是duration of a step in seconds.
summation of time taken by read event and query generate event gives the total execution time of Bex Query.

The explanation of the latter sentence is easy to cause misunderstanding. I think this is a step that takes time. But if this step is opened with AFO, then the time to open the tool must be included.

Therefore, everything has to be analyzed in detail.

STATLEVEL This is the detail level of OLAP statistics recording
0 stands for aggregated data
1 stands for OLAP data
2 stands for OLAP and DM data

One thing to say is that this statistical information is delayed. Near real time

Design query

Set in the condition, sort the top 10 queries based on the number of event: query generation.
Insert picture description here
Insert picture description here
Then calculate the average query time based on the number of query generations .

Guess you like

Origin blog.csdn.net/weixin_45689053/article/details/110521655