开发相关规范 本页介绍天翼云TeleDB数据库开发相关的规范。 1. 建议对DB object尤其是COLUMN加COMMENT,便于后续了解业务及维护。 注释前后的数据表可读性对比,有注释的一看就明白。 plaintext teledb d+ toids; Table "public.toids" Column Type Collation Nullable Default Storage Stats target Descripti on +++++++ id integer not null plain name character varying extended birth timestamp(0) without time zone plain city character varying extended Indexes: "toidspkey" PRIMARY KEY, btree (id) Has OIDs: yes Distribute By: SHARD(id) Location Nodes: ALL DATANODES ^ teledb comment on column toids.name is '姓名'; COMMENT teledb comment on column toids.city is '居住城市'; COMMENT teledb d+ toids; Table "public.toids" Column Type Collation Nullable Default Storage Stats target Descripti on +++++++ id integer not null plain name character varying extended 姓名 birth timestamp(0) without time zone plain city character varying extended 居住城市 Indexes: "toidspkey" PRIMARY KEY, btree (id) Has OIDs: yes Distribute By: SHARD(id) Location Nodes: ALL DATANODES 2. 建议非必须时避免select ,只取所需字段,以减少包括不限于网络带宽消耗。 plaintext teledb