Hi team,
I'm trying to optimize this query size and best method, please let me share if have any best ideas on this optimize.
SQL
select '0sce to 2sec' as Bucket_Name,count(*) from tbllog
where DATE_PART('second', endtimestamp::timestamp - starttimestamp::timestamp) = @StartTime and starttimestamp = @StartTime
and starttimestamp 2 Union select '5sec to 10sec' as Bucket_Name,count(*)
from tbllog
where Process= @Process and starttimestamp >= @StartTime and starttimestamp 5 Union select 'Greater than 10sec' as Bucket_Name, count(*) from tbllog
where Process= @Process and starttimestamp >= @StartTime and starttimestamp 10 )
ORDER BY Bucket_NameThanks


Nitin SontakkeRank #264 · 9.6K reputationPosted Jan 4, 2022, 12:22 AM EST