Skip to content
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
9 changes: 3 additions & 6 deletions audit_log/query_counts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@ WITH
_rnk = 1),
hashedQueries AS (
SELECT
src1.query AS query,
src1.hashed AS hashed
query,
hashed
FROM
src AS src1,
src AS src2
WHERE
src1.hashed = src2.hashed ),
src ),
pricedQueries AS (
SELECT
hashed,
Expand Down
9 changes: 3 additions & 6 deletions audit_log/query_counts_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ WITH
_rnk = 1),
hashedQueries AS (
SELECT
src1.query AS query,
src1.hashed AS hashed
query,
hashed
FROM
src AS src1,
src AS src2
WHERE
src1.hashed = src2.hashed ),
src ),
pricedQueries AS (
SELECT
hashed,
Expand Down
14 changes: 5 additions & 9 deletions audit_log/top_costly_queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,12 @@ WITH
_rnk = 1),
hashedQueries AS (
SELECT
src1.query AS query,
src1.hashed AS hashed,
SUM(src1.totalBilledBytes) AS totalBytesBilled,
COUNT(src1.hashed) AS queryCount
query AS query,
hashed AS hashed,
SUM(totalBilledBytes) AS totalBytesBilled,
COUNT(*) AS queryCount
FROM
jobsDeduplicated AS src1,
jobsDeduplicated AS src2
WHERE
src1.hashed = src2.hashed
AND src1.jobId <> src2.jobId
jobsDeduplicated
GROUP BY
hashed,
query
Expand Down
14 changes: 5 additions & 9 deletions audit_log/top_costly_queries_general.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,12 @@ WITH
_rnk = 1),
hashedQueries AS (
SELECT
src1.query AS query,
src1.hashed AS hashed,
SUM(src1.totalBilledBytes) AS totalBytesBilled,
COUNT(src1.hashed) AS queryCount
query,
hashed,
SUM(totalBilledBytes) AS totalBytesBilled,
COUNT(*) AS queryCount
FROM
jobsDeduplicated AS src1,
jobsDeduplicated AS src2
WHERE
src1.hashed = src2.hashed
AND src1.jobId <> src2.jobId
jobsDeduplicated
GROUP BY
hashed,
query
Expand Down
9 changes: 3 additions & 6 deletions information_schema/query_counts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@ WITH
_rnk = 1 ),
hashedQueries AS (
SELECT
src1.query AS query,
src1.hashed AS hashed
query,
hashed
FROM
jobsDeduplicated AS src1,
jobsDeduplicated AS src2
WHERE
src1.hashed = src2.hashed ),
jobsDeduplicated ),
pricedQueries AS (
SELECT
hashed,
Expand Down
13 changes: 5 additions & 8 deletions information_schema/top_costly_queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,12 @@ BEGIN
),
hashedQueries AS (
SELECT
src1.query AS query,
src1.hashed AS hashed,
SUM(src1.totalBytesBilled) AS totalBytesBilled,
COUNT(src1.hashed) AS queryCount
query,
hashed,
SUM(totalBytesBilled) AS totalBytesBilled,
COUNT(*) AS queryCount
FROM
jobsDeduplicated AS src1, jobsDeduplicated AS src2
WHERE
src1.hashed = src2.hashed AND
src1.jobId <> src2.jobId
jobsDeduplicated
GROUP BY
hashed, query
)
Expand Down