-
Notifications
You must be signed in to change notification settings - Fork 1
/
stl_query.view.lookml
78 lines (60 loc) · 1.71 KB
/
stl_query.view.lookml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
- view: stl_query
sql_table_name: pg_catalog.stl_query
fields:
- dimension: aborted
type: int
sql: ${TABLE}.aborted
- dimension: database
sql: ${TABLE}.database
- dimension_group: endtime
type: time
timeframes: [time, date, week, month]
sql: ${TABLE}.endtime
- dimension: insert_pristine
type: int
sql: ${TABLE}.insert_pristine
- dimension: label
sql: ${TABLE}.label
- dimension: pid
type: int
sql: ${TABLE}.pid
- dimension: query
type: int
sql: ${TABLE}.query
- dimension: querytxt
sql: ${TABLE}.querytxt
- dimension: querytxt_short
sql: LEFT(${TABLE}.querytxt, 200)
- dimension_group: starttime
type: time
timeframes: [time, date, week, month]
sql: ${TABLE}.starttime
- dimension: userid
type: int
sql: ${TABLE}.userid
- dimension: xid
type: int
sql: ${TABLE}.xid
- dimension: elapsed_time
type: int
sql: DATEDIFF(millisecond, ${TABLE}.starttime, ${TABLE}.endtime)
- dimension: elapsed_time_range
type: tier
tiers: [0,10,100,1000,10000,100000]
sql: ${elapsed_time}
- measure: count
type: count
drill_fields: [userid, starttime_date, endtime_date, elapsed_time, querytxt]
- measure: average_query_time
type: number
sql: sum(${elapsed_time}/1000.00) / ${count}
decimals: 2
drill_fields: [userid, starttime_date, endtime_date, elapsed_time, querytxt]
- measure: total_query_time
type: sum
sql: ${elapsed_time}
drill_fields: [userid, starttime_date, endtime_date, elapsed_time, querytxt]
- measure: max_query_time
type: max
sql: ${elapsed_time}/1000
drill_fields: [userid, starttime_date, endtime_date, elapsed_time, querytxt]