@@ -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