Skip to content

Commit 208f25b

Browse files
committed
Update view's field types.
1 parent 82b98c0 commit 208f25b

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

doc/sql.extensions/README.profiler.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ select req.profile_id,
325325
count(*) counter,
326326
min(req.total_time) min_time,
327327
max(req.total_time) max_time,
328-
sum(req.total_time) total_time,
329-
sum(req.total_time) / count(*) avg_time
328+
cast(sum(req.total_time) as bigint) total_time,
329+
cast(sum(req.total_time) / count(*) as bigint) avg_time
330330
from plg$prof_requests req
331331
join plg$prof_statements sta
332332
on sta.profile_id = req.profile_id and
@@ -362,11 +362,11 @@ select pstat.profile_id,
362362
) sql_text,
363363
pstat.line_num,
364364
pstat.column_num,
365-
sum(pstat.counter) counter,
365+
cast(sum(pstat.counter) as bigint) counter,
366366
min(pstat.min_time) min_time,
367367
max(pstat.max_time) max_time,
368-
sum(pstat.total_time) total_time,
369-
sum(pstat.total_time) / nullif(sum(pstat.counter), 0) avg_time
368+
cast(sum(pstat.total_time) as bigint) total_time,
369+
cast(sum(pstat.total_time) / nullif(sum(pstat.counter), 0) as bigint) avg_time
370370
from plg$prof_psql_stats pstat
371371
join plg$prof_statements sta
372372
on sta.profile_id = pstat.profile_id and
@@ -406,17 +406,17 @@ select rstat.profile_id,
406406
rstat.record_source_id,
407407
recsrc.parent_record_source_id,
408408
recsrc.access_path,
409-
sum(rstat.open_counter) open_counter,
409+
cast(sum(rstat.open_counter) as bigint) open_counter,
410410
min(rstat.open_min_time) open_min_time,
411411
max(rstat.open_max_time) open_max_time,
412-
sum(rstat.open_total_time) open_total_time,
413-
sum(rstat.open_total_time) / nullif(sum(rstat.open_counter), 0) open_avg_time,
414-
sum(rstat.fetch_counter) fetch_counter,
412+
cast(sum(rstat.open_total_time) as bigint) open_total_time,
413+
cast(sum(rstat.open_total_time) / nullif(sum(rstat.open_counter), 0) as bigint) open_avg_time,
414+
cast(sum(rstat.fetch_counter) as bigint) fetch_counter,
415415
min(rstat.fetch_min_time) fetch_min_time,
416416
max(rstat.fetch_max_time) fetch_max_time,
417-
sum(rstat.fetch_total_time) fetch_total_time,
418-
sum(rstat.fetch_total_time) / nullif(sum(rstat.fetch_counter), 0) fetch_avg_time,
419-
coalesce(sum(rstat.open_total_time), 0) + coalesce(sum(rstat.fetch_total_time), 0) open_fetch_total_time
417+
cast(sum(rstat.fetch_total_time) as bigint) fetch_total_time,
418+
cast(sum(rstat.fetch_total_time) / nullif(sum(rstat.fetch_counter), 0) as bigint) fetch_avg_time,
419+
cast(coalesce(sum(rstat.open_total_time), 0) + coalesce(sum(rstat.fetch_total_time), 0) as bigint) open_fetch_total_time
420420
from plg$prof_record_source_stats rstat
421421
join plg$prof_record_sources recsrc
422422
on recsrc.profile_id = rstat.profile_id and

src/plugins/profiler/Profiler.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,8 +1047,8 @@ void ProfilerPlugin::createMetadata(ThrowStatusExceptionWrapper* status, RefPtr<
10471047
count(*) counter,
10481048
min(req.total_time) min_time,
10491049
max(req.total_time) max_time,
1050-
sum(req.total_time) total_time,
1051-
sum(req.total_time) / count(*) avg_time
1050+
cast(sum(req.total_time) as bigint) total_time,
1051+
cast(sum(req.total_time) / count(*) as bigint) avg_time
10521052
from plg$prof_requests req
10531053
join plg$prof_statements sta
10541054
on sta.profile_id = req.profile_id and
@@ -1087,11 +1087,11 @@ void ProfilerPlugin::createMetadata(ThrowStatusExceptionWrapper* status, RefPtr<
10871087
) sql_text,
10881088
pstat.line_num,
10891089
pstat.column_num,
1090-
sum(pstat.counter) counter,
1090+
cast(sum(pstat.counter) as bigint) counter,
10911091
min(pstat.min_time) min_time,
10921092
max(pstat.max_time) max_time,
1093-
sum(pstat.total_time) total_time,
1094-
sum(pstat.total_time) / nullif(sum(pstat.counter), 0) avg_time
1093+
cast(sum(pstat.total_time) as bigint) total_time,
1094+
cast(sum(pstat.total_time) / nullif(sum(pstat.counter), 0) as bigint) avg_time
10951095
from plg$prof_psql_stats pstat
10961096
join plg$prof_statements sta
10971097
on sta.profile_id = pstat.profile_id and
@@ -1134,17 +1134,17 @@ void ProfilerPlugin::createMetadata(ThrowStatusExceptionWrapper* status, RefPtr<
11341134
rstat.record_source_id,
11351135
recsrc.parent_record_source_id,
11361136
recsrc.access_path,
1137-
sum(rstat.open_counter) open_counter,
1137+
cast(sum(rstat.open_counter) as bigint) open_counter,
11381138
min(rstat.open_min_time) open_min_time,
11391139
max(rstat.open_max_time) open_max_time,
1140-
sum(rstat.open_total_time) open_total_time,
1141-
sum(rstat.open_total_time) / nullif(sum(rstat.open_counter), 0) open_avg_time,
1142-
sum(rstat.fetch_counter) fetch_counter,
1140+
cast(sum(rstat.open_total_time) as bigint) open_total_time,
1141+
cast(sum(rstat.open_total_time) / nullif(sum(rstat.open_counter), 0) as bigint) open_avg_time,
1142+
cast(sum(rstat.fetch_counter) as bigint) fetch_counter,
11431143
min(rstat.fetch_min_time) fetch_min_time,
11441144
max(rstat.fetch_max_time) fetch_max_time,
1145-
sum(rstat.fetch_total_time) fetch_total_time,
1146-
sum(rstat.fetch_total_time) / nullif(sum(rstat.fetch_counter), 0) fetch_avg_time,
1147-
coalesce(sum(rstat.open_total_time), 0) + coalesce(sum(rstat.fetch_total_time), 0) open_fetch_total_time
1145+
cast(sum(rstat.fetch_total_time) as bigint) fetch_total_time,
1146+
cast(sum(rstat.fetch_total_time) / nullif(sum(rstat.fetch_counter), 0) as bigint) fetch_avg_time,
1147+
cast(coalesce(sum(rstat.open_total_time), 0) + coalesce(sum(rstat.fetch_total_time), 0) as bigint) open_fetch_total_time
11481148
from plg$prof_record_source_stats rstat
11491149
join plg$prof_record_sources recsrc
11501150
on recsrc.profile_id = rstat.profile_id and

0 commit comments

Comments
 (0)