小编mic*_*imo的帖子

Postgres 查询优化,高成本函数

目前我正在使用一个看起来像这样的 postgres 表 (postgres12)


create table if not exists asset (
  id text,
  symbol text not null,
  name text not null
  primary key (id)
);
create table if not exists latest_value (
  timestamp bigint,
  asset text,
  price decimal null,
  market_cap decimal null,
  primary key (asset),
  foreign key (asset)
    references asset (id)
    on delete cascade
);
create table if not exists value_aggregation (
  context aggregation_context,
  timestamp bigint,
  asset text,
  price jsonb null,
  market_cap jsonb null,
  primary key (context, timestamp, asset),
  foreign …
Run Code Online (Sandbox Code Playgroud)

postgresql optimization postgresql-performance

3
推荐指数
1
解决办法
181
查看次数