Merged in feature/parallellogqueries (pull request #132)
Testing Tweaks * parallel * slowestquery * split * cleanup * health * dynamiccores * go * profile * timeout * commitmychanges * taskfile * sqlcheckstart * client * cost * ctxtimeout
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
CREATE VIEW queryCurrentActiveVersions as
|
||||
SELECT DISTINCT
|
||||
q.id as queryId,
|
||||
q.queryId,
|
||||
coalesce(
|
||||
(FIRST_VALUE(av.versionId) OVER (PARTITION BY q.id ORDER BY av.id DESC)),
|
||||
(FIRST_VALUE(av.versionId) OVER (PARTITION BY q.queryId ORDER BY av.activeVersionEntryId DESC)),
|
||||
0
|
||||
)::int as activeVersion
|
||||
FROM queries AS q
|
||||
LEFT JOIN queryActiveVersions as av on av.queryId = q.id;
|
||||
LEFT JOIN queryActiveVersions as av on av.queryId = q.queryId;
|
||||
|
||||
CREATE VIEW queryLatestVersions as
|
||||
SELECT
|
||||
q.id as queryId,
|
||||
coalesce(max(v.id), 0)::int as latestVersion
|
||||
q.queryId,
|
||||
coalesce(max(v.versionId), 0)::int as latestVersion
|
||||
FROM queries AS q
|
||||
LEFT JOIN queryVersions as v on v.queryId = q.id
|
||||
GROUP BY q.id;
|
||||
LEFT JOIN queryVersions as v on v.queryId = q.queryId
|
||||
GROUP BY q.queryId;
|
||||
|
||||
CREATE VIEW queryCurrentConfigs as
|
||||
SELECT av.queryId, c.config
|
||||
@@ -39,12 +39,12 @@ CREATE VIEW queryCurrentRequiredIdsAGG as
|
||||
GROUP BY queryId;
|
||||
|
||||
CREATE VIEW fullActiveQueries AS
|
||||
SELECT DISTINCT q.id, q.type, av.activeVersion, lv.latestVersion, c.config, r.requiredIds
|
||||
SELECT DISTINCT q.queryId, q.queryType, av.activeVersion, lv.latestVersion, c.config, r.requiredIds
|
||||
FROM queries AS q
|
||||
JOIN queryCurrentActiveVersions as av on q.id = av.queryId
|
||||
JOIN queryLatestVersions as lv on lv.queryId = q.id
|
||||
JOIN queryCurrentConfigs AS c ON q.id = c.queryId
|
||||
JOIN queryCurrentRequiredIdsAGG AS r ON q.id = r.queryId;
|
||||
JOIN queryCurrentActiveVersions as av on q.queryId = av.queryId
|
||||
JOIN queryLatestVersions as lv on lv.queryId = q.queryId
|
||||
JOIN queryCurrentConfigs AS c ON q.queryId = c.queryId
|
||||
JOIN queryCurrentRequiredIdsAGG AS r ON q.queryId = r.queryId;
|
||||
|
||||
CREATE VIEW queryActiveDependencies AS
|
||||
WITH RECURSIVE queryActiveDependencies(queryId, requiredQueryId, path, cycle) AS (
|
||||
|
||||
Reference in New Issue
Block a user