This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prom_info.metric can be quite slow. Part of this is due to the columns that deal with disk size. Split the view into two views - one that does not have the size columns and is optimized for speed - and the original (also optimized for better performance) prom_info.metric is now a SQL view (not backed by a function) and it omits the columns dealing with disk size. prom_info.metric_detail is a view that is backed by a function (_prom_catalog.metric_detail) which has the same signature as the original view. i.e. it contains the columns dealing with disk size. If this is a multinode installation (which we don't currently even support), it executes the original query. If this is a singlenode installation (which should be everyone), we use a new optimized query.
- Loading branch information
Showing
6 changed files
with
324 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
DO $block$ | ||
BEGIN | ||
DROP VIEW IF EXISTS prom_info.metric; | ||
DROP FUNCTION IF EXISTS _prom_catalog.metric_view(); | ||
EXCEPTION WHEN dependent_objects_still_exist THEN | ||
RAISE EXCEPTION dependent_objects_still_exist USING | ||
DETAIL = 'The signature of prom_info.metric is changing. ' || | ||
'Dependent objects need to be dropped before the upgrade, and recreated afterwards.', | ||
HINT = 'Drop any objects that depend on prom_info.metric' | ||
; | ||
END; | ||
$block$; |
Oops, something went wrong.