Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust on-demand price to $6.25 #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion audit_log/billing_recommendations_per_query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
MILLISECOND)) AS approximateSlotCount,
ROUND(SAFE_DIVIDE(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, 0),
POW(1024, 4)) * 5, 2) AS onDemandCost,
POW(1024, 4)) * 6.25, 2) AS onDemandCost,
CASE protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.eventName
WHEN 'query_job_completed' THEN 'QUERY'
WHEN 'load_job_completed' THEN 'LOAD'
Expand Down
2 changes: 1 addition & 1 deletion audit_log/billing_recommendations_per_query_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
MILLISECOND)) AS approximateSlotCount,
ROUND(SAFE_DIVIDE(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, 0),
POW(1024, 4)) * 5, 2) AS onDemandCost,
POW(1024, 4)) * 6.25, 2) AS onDemandCost,
CASE protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.eventName
WHEN 'query_job_completed' THEN 'QUERY'
WHEN 'load_job_completed' THEN 'LOAD'
Expand Down
2 changes: 1 addition & 1 deletion audit_log/general_job_information.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobName.projectId AS billingProjectId,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
ROUND(SAFE_DIVIDE(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, 0), POW(1024, 4)) * 5, 2) AS cost,
ROUND(SAFE_DIVIDE(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, 0), POW(1024, 4)) * 6.25, 2) AS cost,
COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, 0) AS totalBilledBytes,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalSlotMs,
TIMESTAMP_DIFF(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/general_job_information_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobName.projectId AS billingProjectId,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
ROUND(SAFE_DIVIDE(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, 0), POW(1024, 4)) * 5, 2) AS cost,
ROUND(SAFE_DIVIDE(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, 0), POW(1024, 4)) * 6.25, 2) AS cost,
COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, 0) AS totalBilledBytes,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalSlotMs,
TIMESTAMP_DIFF(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/longest_running_queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ SELECT
runtimeToBytesBilledRatio,
startTime,
endTime,
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 4)) * 5, 2) AS onDemandCost,
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 4)) * 6.25, 2) AS onDemandCost,
ROUND(COALESCE(totalBytesBilled, 0), 2) AS totalBytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 2), 2) AS totalMegabytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 3), 2) AS totalGigabytesBilled,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/longest_running_queries_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SELECT
runtimeToBytesBilledRatio,
startTime,
endTime,
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 4)) * 5, 2) AS onDemandCost,
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 4)) * 6.25, 2) AS onDemandCost,
ROUND(COALESCE(totalBytesBilled, 0), 2) AS totalBytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 2), 2) AS totalMegabytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 3), 2) AS totalGigabytesBilled,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/query_counts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ WITH
SELECT
query,
queryCount,
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 3)) * 5, 2) AS onDemandCost,
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 3)) * 6.25, 2) AS onDemandCost,
ROUND(COALESCE(totalBytesBilled, 0), 2) AS totalBytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 2), 2) AS totalMegabytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 3), 2) AS totalGigabytesBilled,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/query_counts_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ WITH
SELECT
query,
queryCount,
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 4)) * 5, 2) AS onDemandCost,
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 4)) * 6.25, 2) AS onDemandCost,
ROUND(COALESCE(totalBytesBilled, 0), 2) AS totalBytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 2), 2) AS totalMegabytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 3), 2) AS totalGigabytesBilled,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/query_job_information.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.referencedTables as referencedTables,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.labels as labels,
ROUND(SAFE_DIVIDE(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
0), POW(1024, 4)) * 5, 2) AS onDemandCost,
0), POW(1024, 4)) * 6.25, 2) AS onDemandCost,
ROUND(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
0), 2) AS totalBytesBilled,
ROUND(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/query_job_information_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.referencedTables as referencedTables,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.labels as labels,
ROUND(SAFE_DIVIDE(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
0), POW(1024, 4)) * 5, 2) AS onDemandCost,
0), POW(1024, 4)) * 6.25, 2) AS onDemandCost,
ROUND(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
0), 2) AS totalBytesBilled,
ROUND(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_billed_labels.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ labels AS (
ROUND(SUM(COALESCE(totalBilledBytes,
0)) / POW(1024, 4), 2) AS totalTerabytesBilled,
ROUND(SAFE_DIVIDE(SUM(COALESCE(totalBilledBytes, 0)),
POW(1024, 4)) * 5, 2) AS onDemandCost,
POW(1024, 4)) * 6.25, 2) AS onDemandCost,
labels.key AS labelKey,
labels.value AS labelValue
FROM jobsDeduplicated
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_billed_labels_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ labels AS (
ROUND(SUM(COALESCE(totalBilledBytes,
0)) / POW(1024, 4), 2) AS totalTerabytesBilled,
ROUND(SAFE_DIVIDE(SUM(COALESCE(totalBilledBytes, 0)),
POW(1024, 4)) * 5, 2) AS onDemandCost,
POW(1024, 4)) * 6.25, 2) AS onDemandCost,
labels.key AS labelKey,
labels.value AS labelValue
FROM jobsDeduplicated
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_billed_queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SELECT
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
ROUND(SAFE_DIVIDE(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
0), POW(1024, 3)) * 5, 2) AS onDemandCost,
0), POW(1024, 3)) * 6.25, 2) AS onDemandCost,
ROUND(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
0), 2) AS totalBytesBilled,
ROUND(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_billed_queries_deduplicated.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
ROUND(SAFE_DIVIDE(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
0), POW(1024, 4)) * 5, 2) AS onDemandCost,
0), POW(1024, 4)) * 6.25, 2) AS onDemandCost,
ROUND(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
0), 2) AS totalBytesBilled,
ROUND(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_billed_queries_deduplicated_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
ROUND(SAFE_DIVIDE(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
0), POW(1024, 4)) * 5, 2) AS onDemandCost,
0), POW(1024, 4)) * 6.25, 2) AS onDemandCost,
ROUND(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
0), 2) AS totalBytesBilled,
ROUND(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_billed_queries_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SELECT
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
ROUND(SAFE_DIVIDE(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
0), POW(1024, 4)) * 5, 2) AS onDemandCost,
0), POW(1024, 4)) * 6.25, 2) AS onDemandCost,
ROUND(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
0), 2) AS totalBytesBilled,
ROUND(COALESCE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_complex_queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
ROUND(SAFE_DIVIDE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, POW(1024, 4)) * 5, 2) AS onDemandCost,
ROUND(SAFE_DIVIDE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, POW(1024, 4)) * 6.25, 2) AS onDemandCost,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalSlotMs,
TIMESTAMP_DIFF(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_complex_queries_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
ROUND(SAFE_DIVIDE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, POW(1024, 4)) * 5, 2) AS onDemandCost,
ROUND(SAFE_DIVIDE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, POW(1024, 4)) * 6.25, 2) AS onDemandCost,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalSlotMs,
TIMESTAMP_DIFF(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_cost_user_by_region_and_project.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
ROUND(SAFE_DIVIDE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, POW(1024, 3)) * 5, 2) AS onDemandCost,
ROUND(SAFE_DIVIDE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, POW(1024, 3)) * 6.25, 2) AS onDemandCost,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalSlotMs,
TIMESTAMP_DIFF(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_cost_users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
ROUND(SAFE_DIVIDE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, POW(1024, 4)) * 5, 2) AS onDemandCost,
ROUND(SAFE_DIVIDE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, POW(1024, 4)) * 6.25, 2) AS onDemandCost,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalSlotMs,
TIMESTAMP_DIFF(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_cost_users_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ WITH src AS (
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes,
ROUND(SAFE_DIVIDE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, POW(1024, 4)) * 5, 2) AS onDemandCost,
ROUND(SAFE_DIVIDE(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalBilledBytes, POW(1024, 4)) * 6.25, 2) AS onDemandCost,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalSlotMs,
TIMESTAMP_DIFF(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime,
protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime,
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_costly_queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ SELECT
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 2), 2) AS totalMegabytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 3), 2) AS totalGigabytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 4), 2) AS totalTerabytesBilled,
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 4)) * 5, 2) AS onDemandCost
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 4)) * 6.25, 2) AS onDemandCost
FROM
hashedQueries
ORDER BY
Expand Down
2 changes: 1 addition & 1 deletion audit_log/top_costly_queries_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ SELECT
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 2), 2) AS totalMegabytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 3), 2) AS totalGigabytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 4), 2) AS totalTerabytesBilled,
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 4)) * 5, 2) AS onDemandCost
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 4)) * 6.25, 2) AS onDemandCost
FROM
hashedQueries
ORDER BY
Expand Down
2 changes: 1 addition & 1 deletion information_schema/billing_recommendation_per_query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ WITH
SELECT
*,
ROUND(SAFE_DIVIDE(totalBytesBilled,
POW(1024, 4)) * 5, 2) AS legacyOnDemandCost,
POW(1024, 4)) * 6.25, 2) AS legacyOnDemandCost,
ROUND(SAFE_DIVIDE(totalBytesBilled,
POW(1024, 4)) * 6.25, 2) AS onDemandCost,
(approximateSlotCount/(60*60)) * 0.04 AS standardEditionCost,
Expand Down
2 changes: 1 addition & 1 deletion information_schema/general_job_information.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BEGIN
ROUND(COALESCE(total_bytes_billed, 0) / POW(1024, 4), 2) AS totalTerabytesBilled,
total_slot_ms AS totalSlotMs,
ROUND(SAFE_DIVIDE(total_bytes_billed,
POW(1024, 4)) * 5, 2) AS onDemandCost,
POW(1024, 4)) * 6.25, 2) AS onDemandCost,
ROUND(SAFE_DIVIDE(total_slot_ms,
TIMESTAMP_DIFF(end_time, start_time, MILLISECOND)), 2) AS approximateSlotCount,
ROW_NUMBER() OVER (PARTITION BY job_id ORDER BY end_time DESC) AS _rnk
Expand Down
2 changes: 1 addition & 1 deletion information_schema/longest_running_queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ BEGIN
ROUND(COALESCE(total_bytes_billed,
0) / POW(1024, 4), 2) AS totalTerabytesBilled,
ROUND(SAFE_DIVIDE(total_bytes_billed,
POW(1024, 4)) * 5, 2) AS cost,
POW(1024, 4)) * 6.25, 2) AS cost,
ROUND(SAFE_DIVIDE(total_slot_ms,
TIMESTAMP_DIFF(end_time, start_time, MILLISECOND)), 2) AS approximateSlotCount,
ROW_NUMBER() OVER(PARTITION BY job_id ORDER BY end_time DESC) AS _rnk,
Expand Down
2 changes: 1 addition & 1 deletion information_schema/looker_job_information.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BEGIN
total_bytes_billed AS totalBytesBilled,
total_slot_ms AS totalSlotMs,
ROUND(SAFE_DIVIDE(total_bytes_billed,
POW(1024, 4)) * 5, 2) AS cost,
POW(1024, 4)) * 6.25, 2) AS cost,
ROUND(SAFE_DIVIDE(total_slot_ms,
TIMESTAMP_DIFF(end_time, start_time, MILLISECOND)), 2) AS approximateSlotCount,
ROW_NUMBER() OVER (PARTITION BY job_id ORDER BY end_time DESC) AS _rnk
Expand Down
2 changes: 1 addition & 1 deletion information_schema/query_counts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ WITH
SELECT
query,
queryCount,
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 4)) * 5, 2) AS onDemandCost,
ROUND(SAFE_DIVIDE(totalBytesBilled, POW(1024, 4)) * 6.25, 2) AS onDemandCost,
ROUND(COALESCE(totalBytesBilled, 0), 2) AS totalBytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 2), 2) AS totalMegabytesBilled,
ROUND(COALESCE(totalBytesBilled, 0) / POW(1024, 3), 2) AS totalGigabytesBilled,
Expand Down
2 changes: 1 addition & 1 deletion information_schema/query_job_information.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ WITH
referenced_tables AS referencedTables,
labels,
ROUND(SAFE_DIVIDE(total_bytes_billed,
POW(1024, 4)) * 5, 2) AS onDemandCost,
POW(1024, 4)) * 6.25, 2) AS onDemandCost,
ROUND(COALESCE(total_bytes_billed,
0), 2) AS totalBytesBilled,
ROUND(COALESCE(total_bytes_billed,
Expand Down
2 changes: 1 addition & 1 deletion information_schema/top_billed_labels.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ BEGIN
ROUND(SUM(COALESCE(totalBilledBytes,
0)) / POW(1024, 4), 2) AS totalTerabytesBilled,
ROUND(SAFE_DIVIDE(SUM(COALESCE(totalBilledBytes, 0)),
POW(1024, 4)) * 5, 2) AS onDemandCost,
POW(1024, 4)) * 6.25, 2) AS onDemandCost,
labelKey,
labelValue
FROM jobsDeduplicated
Expand Down
2 changes: 1 addition & 1 deletion information_schema/top_billed_queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ BEGIN
ROUND(COALESCE(total_bytes_billed,
0) / POW(1024, 4), 2) AS totalTerabytesBilled,
ROUND(SAFE_DIVIDE(total_bytes_billed,
POW(1024, 4)) * 5, 2) AS cost,
POW(1024, 4)) * 6.25, 2) AS cost,
ROUND(SAFE_DIVIDE(total_slot_ms,
TIMESTAMP_DIFF(end_time, start_time, MILLISECOND)), 2) AS approximateSlotCount,
ROW_NUMBER() OVER(PARTITION BY job_id ORDER BY end_time DESC) AS _rnk
Expand Down
Loading