feat(db): create new indexes
This commit is contained in:
parent
e60f264a27
commit
8996a04965
4 changed files with 5 additions and 0 deletions
|
|
@ -8,5 +8,6 @@ $$ LANGUAGE sql IMMUTABLE;
|
|||
|
||||
ALTER TABLE public.metrics
|
||||
ADD COLUMN IF NOT EXISTS active boolean NOT NULL DEFAULT TRUE;
|
||||
CREATE INDEX IF NOT EXISTS resources_timestamp_duration_durationgt0NN_idx ON events.resources (timestamp, duration) WHERE duration > 0 AND duration IS NOT NULL;
|
||||
COMMIT;
|
||||
ALTER TYPE public.error_source ADD VALUE IF NOT EXISTS 'elasticsearch'; -- cannot add new value inside a transaction block
|
||||
|
|
@ -1061,6 +1061,7 @@ $$
|
|||
CREATE INDEX IF NOT EXISTS resources_session_id_timestamp_url_host_firstparty_idx ON events.resources (session_id, timestamp, url_host) WHERE type IN ('fetch', 'script');
|
||||
CREATE INDEX IF NOT EXISTS resources_session_id_timestamp_duration_durationgt0NN_img_idx ON events.resources (session_id, timestamp, duration) WHERE duration > 0 AND duration IS NOT NULL AND type = 'img';
|
||||
CREATE INDEX IF NOT EXISTS resources_timestamp_session_id_idx ON events.resources (timestamp, session_id);
|
||||
CREATE INDEX IF NOT EXISTS resources_timestamp_duration_durationgt0NN_idx ON events.resources (timestamp, duration) WHERE duration > 0 AND duration IS NOT NULL;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS events.performance
|
||||
(
|
||||
|
|
|
|||
|
|
@ -8,5 +8,7 @@ $$ LANGUAGE sql IMMUTABLE;
|
|||
|
||||
ALTER TABLE public.metrics
|
||||
ADD COLUMN IF NOT EXISTS active boolean NOT NULL DEFAULT TRUE;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS resources_timestamp_duration_durationgt0NN_idx ON events.resources (timestamp, duration) WHERE duration > 0 AND duration IS NOT NULL;
|
||||
COMMIT;
|
||||
ALTER TYPE public.error_source ADD VALUE IF NOT EXISTS 'elasticsearch'; -- cannot add new value inside a transaction block
|
||||
|
|
@ -839,6 +839,7 @@ $$
|
|||
CREATE INDEX resources_session_id_timestamp_url_host_firstparty_idx ON events.resources (session_id, timestamp, url_host) WHERE type IN ('fetch', 'script');
|
||||
CREATE INDEX resources_session_id_timestamp_duration_durationgt0NN_img_idx ON events.resources (session_id, timestamp, duration) WHERE duration > 0 AND duration IS NOT NULL AND type = 'img';
|
||||
CREATE INDEX resources_timestamp_session_id_idx ON events.resources (timestamp, session_id);
|
||||
CREATE INDEX resources_timestamp_duration_durationgt0NN_idx ON events.resources (timestamp, duration) WHERE duration > 0 AND duration IS NOT NULL;
|
||||
|
||||
CREATE TABLE events.performance
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue