064 queries optimized
This commit is contained in:
+1
-1
@@ -89,7 +89,7 @@
|
|||||||
<!--- global settings --->
|
<!--- global settings --->
|
||||||
|
|
||||||
<cfset request.RECORDS_PER_PAGE=500/>
|
<cfset request.RECORDS_PER_PAGE=500/>
|
||||||
<cfset request.APP_VERSION="0.00.063"/>
|
<cfset request.APP_VERSION="0.00.064"/>
|
||||||
<cfset request.STAND=getStand()/>
|
<cfset request.STAND=getStand()/>
|
||||||
|
|
||||||
<cflock scope="application" type="readonly" timeout=3>
|
<cflock scope="application" type="readonly" timeout=3>
|
||||||
|
|||||||
@@ -97,8 +97,8 @@
|
|||||||
) tm on (t.id = tm.tenant_id AND tm.rn = 1)
|
) tm on (t.id = tm.tenant_id AND tm.rn = 1)
|
||||||
left outer join ngcloud_ru.metadata m on (tm.metadata_id=m.id)
|
left outer join ngcloud_ru.metadata m on (tm.metadata_id=m.id)
|
||||||
where length(m.clientid) > 0
|
where length(m.clientid) > 0
|
||||||
AND capacity_resource.timestamp::date >= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_start#/>
|
AND capacity_resource.timestamp >= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_start#/>
|
||||||
AND capacity_resource.timestamp::date <= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_finish#/>
|
AND capacity_resource.timestamp < <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dateAdd("d",1,dt_finish)#/>
|
||||||
group by m.clientid, vdc.name
|
group by m.clientid, vdc.name
|
||||||
order by m.clientid, vdc.name;
|
order by m.clientid, vdc.name;
|
||||||
</cfquery>
|
</cfquery>
|
||||||
@@ -149,8 +149,8 @@
|
|||||||
left outer join ngcloud_ru.metadata m on (tm.metadata_id=m.id)
|
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
|
join ngcloud_ru.storage_profile_types on capacity_storage.storage_profile_types_id=storage_profile_types.id
|
||||||
where length(m.clientid) > 0
|
where length(m.clientid) > 0
|
||||||
AND capacity_storage.timestamp::date >= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_start#/>
|
AND capacity_storage.timestamp >= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_start#/>
|
||||||
AND capacity_storage.timestamp::date < <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_finish#/>
|
AND capacity_storage.timestamp < <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dateAdd("d",1,dt_finish)#/>
|
||||||
group by m.clientid, vdc.name, storage_profile_types.name
|
group by m.clientid, vdc.name, storage_profile_types.name
|
||||||
order by m.clientid, vdc.name, storage_profile_types.name;
|
order by m.clientid, vdc.name, storage_profile_types.name;
|
||||||
</cfquery>
|
</cfquery>
|
||||||
@@ -191,8 +191,8 @@ HOT_FREE_LIMIT 1 10 1 100
|
|||||||
join s3billing.placement ON s3billing.placement.id=bucket_stat.placement_id
|
join s3billing.placement ON s3billing.placement.id=bucket_stat.placement_id
|
||||||
join s3billing.bucket_info ON bucket_info.id=bucket_stat.bucket_id
|
join s3billing.bucket_info ON bucket_info.id=bucket_stat.bucket_id
|
||||||
where bucket_stat.placement_id in (1,2)
|
where bucket_stat.placement_id in (1,2)
|
||||||
AND bucket_stat.timestamp_addition::date >= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_start#/>
|
AND bucket_stat.timestamp_addition >= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_start#/>
|
||||||
AND bucket_stat.timestamp_addition::date <= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_finish#/>
|
AND bucket_stat.timestamp_addition < <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dateAdd("d",1,dt_finish)#/>
|
||||||
group by bucket_stat.owner, bucket_stat.placement_id
|
group by bucket_stat.owner, bucket_stat.placement_id
|
||||||
order by bucket_stat.owner, bucket_stat.placement_id;
|
order by bucket_stat.owner, bucket_stat.placement_id;
|
||||||
</cfquery>
|
</cfquery>
|
||||||
@@ -279,8 +279,8 @@ select
|
|||||||
join s3billing.bucket_info on usage_bucket_by_user.bucketid=bucket_info.id
|
join s3billing.bucket_info on usage_bucket_by_user.bucketid=bucket_info.id
|
||||||
join s3billing.placement on bucket_info.placement_id=placement.id
|
join s3billing.placement on bucket_info.placement_id=placement.id
|
||||||
where 1=1
|
where 1=1
|
||||||
AND usage_bucket_by_user.time::date >= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_start#/>
|
AND usage_bucket_by_user.time >= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_start#/>
|
||||||
AND usage_bucket_by_user.time::date <= <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dt_finish#/>
|
AND usage_bucket_by_user.time < <cfqueryparam cfsqltype="cf_sql_timestamp" value=#dateAdd("d",1,dt_finish)#/>
|
||||||
group by user_info.name, bucket_info.placement_id
|
group by user_info.name, bucket_info.placement_id
|
||||||
order by user_info.name, bucket_info.placement_id;
|
order by user_info.name, bucket_info.placement_id;
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|||||||
Reference in New Issue
Block a user