小编Xsa*_*san的帖子

如果检查“为空”,则选择视图时性能不佳

我有两个非常简单的表,以及在bigint字段上加入它们的视图:

CREATE TABLE foo.ao (
  id serial NOT NULL,
  ao_id bigint NOT NULL,
  ao_plz text,
  ao_community text,
  ao_street text,
  ao_ms_id text,
  ao_status text DEFAULT 'Standard'::character varying,
  ao_has_eear boolean,
  ao_last_update timestamp without time zone,
  CONSTRAINT ao_pkey PRIMARY KEY (id),
  CONSTRAINT ao_id_unique UNIQUE (ao_id)
);

CREATE TABLE foo.ms (
  id serial NOT NULL,
  ms_nis_number text NOT NULL,
  ms_plz text,
  ms_community text,
  ms_street text,
  ms_status text DEFAULT 'Standard'::character varying,
  ms_coord_x integer,
  ms_coord_y integer,
  ms_ao_id bigint,
  CONSTRAINT ms_pkey PRIMARY KEY (id),
  CONSTRAINT …
Run Code Online (Sandbox Code Playgroud)

postgresql performance view postgresql-9.3 postgresql-performance

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