From d9de157635c6fb8d3268d2dd169b2e7eafdcd0af Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Jul 2026 13:14:02 +0300 Subject: [PATCH] 064 queries optimized --- Application.cfc | 2 +- payg.cfm | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Application.cfc b/Application.cfc index bb8cde8..7e75e76 100644 --- a/Application.cfc +++ b/Application.cfc @@ -89,7 +89,7 @@ - + diff --git a/payg.cfm b/payg.cfm index d15ee2b..4f8d094 100644 --- a/payg.cfm +++ b/payg.cfm @@ -97,8 +97,8 @@ ) tm on (t.id = tm.tenant_id AND tm.rn = 1) left outer join ngcloud_ru.metadata m on (tm.metadata_id=m.id) where length(m.clientid) > 0 - AND capacity_resource.timestamp::date >= - AND capacity_resource.timestamp::date <= + AND capacity_resource.timestamp >= + AND capacity_resource.timestamp < group by m.clientid, vdc.name order by m.clientid, vdc.name; @@ -149,8 +149,8 @@ left outer join ngcloud_ru.metadata m on (tm.metadata_id=m.id) join ngcloud_ru.storage_profile_types on capacity_storage.storage_profile_types_id=storage_profile_types.id where length(m.clientid) > 0 - AND capacity_storage.timestamp::date >= - AND capacity_storage.timestamp::date < + AND capacity_storage.timestamp >= + AND capacity_storage.timestamp < group by m.clientid, vdc.name, storage_profile_types.name order by m.clientid, vdc.name, storage_profile_types.name; @@ -191,8 +191,8 @@ HOT_FREE_LIMIT 1 10 1 100 join s3billing.placement ON s3billing.placement.id=bucket_stat.placement_id join s3billing.bucket_info ON bucket_info.id=bucket_stat.bucket_id where bucket_stat.placement_id in (1,2) - AND bucket_stat.timestamp_addition::date >= - AND bucket_stat.timestamp_addition::date <= + AND bucket_stat.timestamp_addition >= + AND bucket_stat.timestamp_addition < group by bucket_stat.owner, bucket_stat.placement_id order by bucket_stat.owner, bucket_stat.placement_id; @@ -279,8 +279,8 @@ select join s3billing.bucket_info on usage_bucket_by_user.bucketid=bucket_info.id join s3billing.placement on bucket_info.placement_id=placement.id where 1=1 - AND usage_bucket_by_user.time::date >= - AND usage_bucket_by_user.time::date <= + AND usage_bucket_by_user.time >= + AND usage_bucket_by_user.time < group by user_info.name, bucket_info.placement_id order by user_info.name, bucket_info.placement_id;