|
|
@ -1,22 +1,29 @@ |
|
|
|
create table public.logs |
|
|
|
( |
|
|
|
uid varchar not null, |
|
|
|
level varchar, |
|
|
|
name varchar, |
|
|
|
type varchar, |
|
|
|
time timestamp, |
|
|
|
timing varchar not null, |
|
|
|
configId varchar, |
|
|
|
requestId varchar, |
|
|
|
serviceId varchar, |
|
|
|
msg varchar, |
|
|
|
payload jsonb |
|
|
|
uid varchar not null, |
|
|
|
level varchar, |
|
|
|
name varchar, |
|
|
|
type varchar, |
|
|
|
time timestamp, |
|
|
|
timing varchar not null, |
|
|
|
configId varchar, |
|
|
|
requestId varchar, |
|
|
|
serviceId varchar, |
|
|
|
userId varchar, |
|
|
|
msg varchar, |
|
|
|
payload jsonb |
|
|
|
-- day integer not null |
|
|
|
); |
|
|
|
-- PARTITION BY RANGE (day); |
|
|
|
|
|
|
|
create unique index IF NOT EXISTS logs_pk_with_uid_idx on public.logs (uid, time); |
|
|
|
create index IF NOT EXISTS timeunix_level_idx on public.logs (time, level); |
|
|
|
create index if not exists index_level on public.logs (level); |
|
|
|
create index if not exists index_msg on public.logs (msg); |
|
|
|
create index if not exists index_requestid on public.logs (requestid); |
|
|
|
create index if not exists index_time on public.logs (time); |
|
|
|
create index if not exists index_type on public.logs (type); |
|
|
|
create index if not exists index_userid on public.logs (userid); |
|
|
|
|
|
|
|
-- do $$ |
|
|
|
-- declare |
|
|
|