Refactoring code and optimize import
This commit is contained in:
parent
d0090f8b7a
commit
fba0cd031b
@ -95,7 +95,6 @@ $$
|
|||||||
END;
|
END;
|
||||||
$$;
|
$$;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS edge_event (
|
CREATE TABLE IF NOT EXISTS edge_event (
|
||||||
id uuid NOT NULL,
|
id uuid NOT NULL,
|
||||||
created_time bigint NOT NULL,
|
created_time bigint NOT NULL,
|
||||||
@ -110,7 +109,6 @@ CREATE TABLE IF NOT EXISTS edge_event (
|
|||||||
) PARTITION BY RANGE (created_time);
|
) PARTITION BY RANGE (created_time);
|
||||||
CREATE INDEX IF NOT EXISTS idx_edge_event_tenant_id_and_created_time ON edge_event(tenant_id, created_time DESC);
|
CREATE INDEX IF NOT EXISTS idx_edge_event_tenant_id_and_created_time ON edge_event(tenant_id, created_time DESC);
|
||||||
|
|
||||||
|
|
||||||
CREATE OR REPLACE PROCEDURE migrate_edge_event(IN start_time_ms BIGINT, IN end_time_ms BIGINT, IN partition_size_ms BIGINT)
|
CREATE OR REPLACE PROCEDURE migrate_edge_event(IN start_time_ms BIGINT, IN end_time_ms BIGINT, IN partition_size_ms BIGINT)
|
||||||
LANGUAGE plpgsql AS
|
LANGUAGE plpgsql AS
|
||||||
$$
|
$$
|
||||||
@ -132,4 +130,4 @@ BEGIN
|
|||||||
FROM old_edge_event
|
FROM old_edge_event
|
||||||
WHERE created_time >= start_time_ms AND created_time < end_time_ms;
|
WHERE created_time >= start_time_ms AND created_time < end_time_ms;
|
||||||
END;
|
END;
|
||||||
$$;
|
$$;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user