热门云主机特惠53.3元/年起!
查看详情

活动

天翼云最新优惠活动,涵盖免费试用,产品折扣等,助您降本增效!
热门活动
  • 天翼云 12.12 国云智算 双11好价不散场,热门云主机特惠53.3元/年起!
  • 安全隔离版OpenClaw NEW OpenClaw云服务器专属“龙虾“套餐低至3.5折起
  • 聚力AI赋能 天翼云大模型专项 大模型特惠专区·Token Plan 轻享包低至9.9元起
  • 青云志云端助力计划 NEW 一站式科研助手,海外资源安全访问平台,助力青年翼展宏图,平步青云
  • 企业出海解决方案 NEW 助力您的业务扬帆出海,通达全球!
  • 天翼云信创专区 NEW “一云多芯、一云多态”,国产化软件全面适配,国产操作系统及硬件芯片支持丰富
  • 云上钜惠 爆款云主机全场特惠,2核4G只要1.8折起!
  • 天翼云奖励推广计划 加入成为云推官,推荐新用户注册下单得现金奖励
免费活动
  • 免费试用中心 HOT 多款云产品免费试用,快来开启云上之旅
  • 天翼云用户体验官 NEW 您的洞察,重塑科技边界

息壤智算

领先开放的智算服务平台,提供算力、平台、数据、模型、应用“五位一体”智算服务体系,构建全流程的AI基础设施能力
星辰TokenHub
  • 模型广场
  • 体验中心
  • 服务接入
星辰MaaS平台
  • 星辰MaaS智能体平台
  • 星辰大模型
大模型
  • glm-5.3-flash
  • GLM-5.2
  • deepseek-v4-pro-0813
  • deepseek-v4-flash-0731-new
  • qwen3.8-flash
AI Store
  • 算力市场
  • 模型市场
  • 应用市场
应用托管
  • 天翼云DramaFlow2.0
  • 应用实例
科研助手
  • 开发机
  • 并行计算
训推服务
  • 模型开发
  • 训练任务
  • 服务部署
智能体引擎
  • 智能体引擎
可信数据空间
  • 可信数据空间
公共算力服务
  • 裸金属
  • 定制裸金属
智算一体机
  • 智算一体机
模型适配专家服务
  • 模型适配专家服务
算力服务商
  • 入驻算力服务商

应用商城

天翼云精选行业优秀合作伙伴及千余款商品,提供一站式云上应用服务
进入甄选商城进入AI Store公有云生态专区智云上海应用生态专区
建站工具
  • 新域名服务
  • SSL证书
  • 翼建站
企业办公
  • 智教云电脑
  • WPS 365 天翼云版
灾备迁移
  • 云管家2.0
  • 翼备份(SaaS版)
  • 琥珀数据压缩归档服务
智慧教育
  • 智擎思政平台(个人版)
  • 智擎研学平台(个人专业版)

定价

协助您快速了解云产品计费模式、价格详情,轻松预估上云成本
价格计算器
  • 动态测算产品价格
定价策略
  • 快速了解计费模式

合作伙伴

天翼云携手合作伙伴,共创云上生态,合作共赢
天翼云生态合作中心
  • 天翼云生态合作中心
天翼云渠道合作伙伴
  • 天翼云代理渠道合作伙伴
天翼云服务合作伙伴
  • 天翼云集成商交付能力认证
天翼云应用合作伙伴
  • 天翼云甄选商城合作伙伴
天翼云技术合作伙伴
  • 天翼云OpenAPI中心
天翼云培训认证
  • 天翼云学堂
天翼信创云专区
  • 信创云专区
  • 适配互认证

开发者

开发者相关功能入口汇聚
技术社区
  • 专栏文章
  • 互动问答
  • 技术视频
资源与工具
  • OpenAPI中心
  • 智能体能力空间
培训与认证
  • 天翼云学堂
  • 天翼云认证
开源社区
  • 魔乐社区
  • OpenTeleDB

支持与服务

为您提供全方位支持与服务,全流程技术保障,助您轻松上云,安全无忧
文档与工具
  • 文档中心
  • 新手上云
  • 自助服务
  • OpenAPI中心
定价
  • 价格计算器
  • 定价策略
基础服务
  • 售前咨询
  • 在线支持
  • 在线支持
  • 工单服务
  • 服务保障
增值服务
  • 红心服务
  • 首保服务
  • 客户支持计划
  • 专家技术服务
  • 备案管家
我要反馈
  • 建议与反馈
  • 用户体验官
信息公告
  • 客户公告

了解天翼云

天翼云秉承央企使命,致力于成为数字经济主力军,投身科技强国伟大事业,为用户提供安全、普惠云服务
品牌介绍
  • 关于天翼云
  • 智算云
  • 新闻资讯
  • 天翼云APP
基础设施
  • 全球基础设施
  • 信任中心
最佳实践
  • 精选案例
  • 超级探访
  • 云杂志
  • 分析师和白皮书
  • 天翼云·创新直播间
市场活动
  • 2026智能云生态大会
  • 2025智能云生态大会
  • 2024智算云生态大会
  • 2023云生态大会
  • 2022云生态大会
  • 天翼云中国行
天翼云
  • 活动
  • 息壤智算
  • 产品
  • 解决方案
  • 应用商城
  • 定价
  • 合作伙伴
  • 开发者
  • 支持与服务
  • 了解天翼云
      • 文档
      • 控制中心
      • 备案
      • 管理中心
      天翼云云网融合解决方案_相关内容
      • 创建分区表
        本文为您介绍如何创建分区表。 创建范围分区表 plaintext teledb create table trange (f1 bigint,f2 timestamp default now(), f3 integer) partition by range (f3) begin (1) step (50) partitions (3) distribute by shard(f1); CREATE TABLE teledb insert into trange(f1,f3) values(1,1),(2,50),(3,100),(2,110); COPY 4 teledb insert into trange(f1,f3) values(1,1),(2,50),(3,100),(2,110); COPY 4 teledb d+ trange; Table "public.trange" Column Type Collation Nullable Default Storage Stats target Description +++++++ f1 bigint plain f2 timestamp without time zone now() plain f3 integer plain Distribute By: SHARD(f1) Location Nodes: ALL DATANODES Partition By: RANGE(f3) Of Partitions: 3 Start With: 1 Interval Of Partition: 50 创建时间范围分区表 plaintext teledb create table ttimerange (f1 bigint, f2 timestamp ,f3 bigint) partition by range (f2) begin (timestamp without time zone '20170901 0:0:0') step (interval '1 month') partitions (12) distribute by shard(f1); CREATE TABLE teledb d+ ttimerange Table "public.ttimerange" Column Type Collation Nullable Default Storage Stats target Description +++++++ f1 bigint plain f2 timestamp without time zone plain f3 bigint plain Distribute By: SHARD(f1) Location Nodes: ALL DATANODES Partition By: RANGE(f2)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V2.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        数据表管理
        创建分区表
      • 创建数据库
        d dbgbk Did not find any relation named "dbgbk". teledb l+ dbgbk List of databases Name Owner Encoding Collate Ctype Access privileges Size Tablespace Description ++++++++ dbgbk teledb GBK zhCN.gbk zhCN.gbk 19 MB pgdefault (1 row) 指定排序规则 plaintext teledb create database teledbdblccollate lccollate 'C' template template0; CREATE DATABASE 指定分组规则 plaintext teledb create database teledblcctype LCCTYPE 'C' template template0; CREATE DATABASE 配置数据可连接 plaintext teledb create database teledballowconnections ALLOWCONNECTIONS true; CREATE DATABASE teledb select datallowconn from pgdatabase where datname 'teledballowconnections'; datallowconn t (1 row) teledb c teledballowconnections You are now connected to database "teledballowconnections" as user "teledb". 配置连接数 plaintext teledb create database teledbconnlimit CONNECTION LIMIT 100; CREATE DATABASE teledb select datconnlimit from pgdatabase where datname'teledbconnlimit'; datconnlimit 100 (1 row) 配置数据库可以被复制(是否模板数据库) plaintext teledb create database teledbistemplate istemplate true; CREATE DATABASE teledb select datconnlimit from pgdatabase where datname'teledbconnlimit'; datconnlimit 100 (1 row) 多个参数一起配置 plaintext teledb create database teledbmul owner teledbuser CONNECTION LIMIT 50 template template0 encoding 'utf8' lccollate 'C'; CREATE DATABASE
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V2.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        数据库管理
        创建数据库
      • copy使用
        id name birth city +++ 1 张三 20001201 00:00:00 北京 2 李四 19970324 00:00:00 上海 3 王五 20040901 00:00:00 广州
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        copy使用
      • 创建分区表
        Of Partitions: 12 Start With: 20170901 Interval Of Partition: 1 MONTH 说明 partion by range(xx) 代表范围分区, 支持timesamp,int类型,数据分布于那个子表就是根据这个字段值来计算分区。 begin(xx) 表示开始分区的初始值。 partition(xx) 代表初始分区数量。 step (xx) 代表分区步长。
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        数据表管理
        创建分区表
      • 集群监控
        集群监控页面展示整个集群监控指标,可以从实例的整体全局上了解实例的运行状态。 操作场景 集群监控页面展示整个集群监控指标,可以从实例的整体全局上了解实例的运行状态。 操作步骤 1. 以用户名和密码登录分布式数据库 控制台,在左侧导航树单击实例监控 ,选择集群监控 页签。 2. 选择需要查看的时间范围。 集群监控页面包含了以下指标信息: 容量占用率:所有节点数据目录大小之和 / 所有节点磁盘总量之和。 总请求数:所有DN节点总请求数之和。 读请求数:所有DN节点读请求数之和。 写请求数:所有DN节点写请求数之和。 其他请求数:所有DN节点其他请求数之和。 总连接数:所有DN节点连接数之和。
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V2.0.0版本产品文档
        管理平台使用手册
        实例监控
        集群监控
      • TRUNCATE操作
        truncate ttimerange partition for ('20170901' ::timestamp without time zone); TRUNCATE TABLE teledb select from ttimerange; f1 f2 f3 ++ 1 20171001 00:00:00 100 1 20171101 00:00:00 100 (2 rows) truncate 一个数字分区表 plaintext teledb select from trange; f1 f2 f3 ++ 1 20230823 10:29:46.263768 1 2 20230823 10:29:46.263768 50 2 20230823 10:29:46.263768 110 3 20230823 10:29:46.263768 100 (4 rows) teledb d+ trange Table "public.trange" Column Type Collation Nullable Default Storage Stats target Description +++++++ f1 bigint plain f2 timestamp without time zone now() plain f3 integer plain Distribute By: SHARD(f1) Location Nodes: ALL DATANODES Partition By: RANGE(f3) Of Partitions: 3 Start With: 1 Interval Of Partition: 50 teledb truncate trange partition for (1); TRUNCATE TABLE teledb truncate trange partition for (2); TRUNCATE TABLE teledb select from trange; f1 f2 f3 ++ 2 20230823 10:29:46.263768 110 3 20230823 10:29:46.263768 100 (2 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        TRUNCATE操作
      • where 条件使用
        本文为您介绍如何在使用SELECT语法时添加where条件。 单条件查询 plaintext teledb select from teledbpg where id 1; id nickname + 1 teledb 1 hello,pgxc (2 rows) 多条件and plaintext teledb select from teledbpg where id 1 and nickname like '%h%' ; id nickname + 1 hello,pgxc (1 row) 多条件or plaintext teledb select from teledbpg where id 1 or nickname like '%p%' ; id nickname + 1 teledb 1 hello,pgxc 3 pg (3 rows) ilike 不区分大小写匹配 plaintext teledb insert into teledbpg values(2,'TELEDB'); INSERT 0 1 teledb select from teledbpg where nickname ilike '%te%'; id nickname + 1 teledb 2 TELEDB (2 rows) where 条件也能支持子查询 plaintext teledb select from teledbpg where id(select (random())::integer from teledbpg order by random() limit 1); id nickname + (0 rows) teledb select from teledbpg where id(select (random())::integer from teledbpg order by random() limit 1); id nickname + 1 teledb 1 hello,pgxc (2 rows) null 值查询方法 plaintext teledb select from teledbpg where nickname is null; id nickname + 4 (1 row) teledb select from teledbpg where nickname is not null; id nickname + 1 teledb 3 pg 1 hello,pgxc 2 TELEDB (4 rows) exists 只要有记录返回就为真 plaintext teledb
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        where 条件使用
      • 多字段索引
        explain select from tmulidx where f11 or f22 or f33 ; QUERY PLAN Remote Fast Query Execution (cost0.00..0.00 rows0 width0) Node/s: dn001, dn002 > Seq Scan on tmulidx (cost0.00..12966.87 rows3 width16) Filter: ((f1 1) OR (f2 2) OR (f3 3)) (4 rows) Time: 3.153 ms 如果返回字段全部在索引文件中,则只需要扫描索引,IO 开销会更少。 plaintext teledb explain select f1,f2,f3 from tmulidx where f11 ; QUERY PLAN Remote Fast Query Execution (cost0.00..0.00 rows0 width0) Node/s: dn01 > Index Only Scan using tmulidxidx on tmulidx (cost0.42..8.44 rows1 width12) Index Cond: (f1 1) (4 rows) Time: 2.630 ms 更新性能比单字段多索引文件要好 多字段 plaintext teledb truncate table tmulidx; TRUNCATE TABLE Time: 44.930 ms teledb insert into tmulidx select t,t,t,t from generateseries(1,1000000) as t; INSERT 0 1000000 Time: 1985.901 ms (00:01.986) 单字段 plaintext teledb create table tsimpleidx (f1 int,f2 int,f3 int,f4 int); CREATE TABLE teledb create index tsimpleidxidx on tsimpleidx(f1); CREATE INDEX teledb create index tsimpleidxidx1 on tsimpleidx(f2); CREATE INDEX teledb create index tsimpleidxidx2 on tsimpleidx(f3); CREATE INDEX teledb
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        索引管理
        多字段索引
      • TeleDB管控服务安装部署
        该任务用于指导软件工程师安装部署teledb管控服务。 该任务用于指导软件工程师安装部署teledb管控服务。 前提条件 已初始化环境,包括创建teledb用户,挂载磁盘,并给于sudo权限。 操作步骤 以下操作以x86安装包为例: 1. 创建根目录提供给挂载盘/data使用,并给于sudo权限。 plaintext mkdir p /data mount /dev/vdb /data echo "UUID"blkid /dev/vdbcut d '"' f2" /data xfs defaults 0 0" sudo tee a /etc/fstab 2. 上传并解压安装包 plaintext cd /app 上传teledbdeployx86centos.zip和teledbxossxxxi.x8664.rpm至app目录下。 unzip teledbdeployx86centos.zip cd teledbdeployx86centos/teledbxmirror/pgxzm cp teledbxossxxxi.x8664.rpm 3. 安装dos2unix 执行如下命令 plaintext cd /app/teledbdeployx86centos/teledbxmirror/deploy/utils/ rpm ivh dos2unix6.0.34.el7.x8664.rpm 出现如下回显信息。 plaintext cd /app chmod R 755 teledbdeployx86centos chown R teledb:teledb /app 4. 修改配置文件role.info和ossinit.conf。 执行如下命令修改role.info配置文件。 plaintext su teledb cd /app/teledbdeployx86centos/teledbxmgr/conf vim role.info 您可按照如下模版修改配置文件内容: 需要修改的就是主机ip、ssh端口、ssh连接用户(teledb)、用户密码
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        安装部署手册
        安装过程
        TeleDB管控服务安装部署
      • 查询记录所在DN
        xcnodeid nodename id nickname +++ 1085152094 dn01 5 test 1085152094 dn01 6 teledb, teledb1 506537247 dn02 3 pg
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        查询记录所在DN
      • not in中包含了null,结果全为真
        id nickname + 2 TELEDB 4
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        not in中包含了null,结果全为真
      • all 用法
        id nickname + 4
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        all 用法
      • any 用法
        id nickname + 3 pg 4 2 TELEDB
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        any 用法
      • 合并多个查询结果
        本文为你介绍合并多个查询结果的方法。 不过滤重复的记录。 plaintext teledb create table teledbpg1(id int, nickname varchar); CREATE TABLE teledb insert into teledbpg1 values(3, 'pg'),(5,'test'); COPY 2 teledb select from teledbpg union all select from teledbpg1; id nickname + 1 teledb 1 hello,pgxc 2 TELEDB 3 pg 4 5 test 3 pg (7 rows) 过滤重复的记录。 plaintext teledb select from teledbpg union select from teledbpg1; id nickname + 1 teledb 1 hello,pgxc 4 5 test 2 TELEDB 3 pg (6 rows) 每个子查询分布在合并结果中的使用。 plaintext teledb select from (select from teledbpg limit 2) as t union all select from (select from teledbpg1 limit 2) teledb ; id nickname + 1 teledb 1 hello,pgxc 5 test 3 pg (4 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        合并多个查询结果
      • 普通索引
        本文为您介绍如何管理普通索引。 plaintext teledb create index tididx on t1 using btree(id); CREATE INDEX
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        索引管理
        普通索引
      • 删除索引
        本文为您介绍如何删除索引。 plaintext teledb drop index tmulidxidx; DROP INDEX
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        索引管理
        删除索引
      • 修改表结构
        Column Type Collation Nullable Default Storage Stats target Description +++++++ id integer plain mc text extended 这是一条字段注释 age integer plain
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        修改表结构
      • 唯一索引
        本文为您介绍如何创建唯一索引。 创建唯一索引 plaintext teledb create unique index tasiduidx on tas using btree(id); CREATE INDEX 非shard key 字段不能建立唯一索引 plaintext teledb create unique index tasiduidx on tas using btree(mc); ERROR: Unique index of partitioned table must contain the hash/modulo distribution column.
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        索引管理
        唯一索引
      • 添加分区子表
        本文为您介绍如何添加分区子表。 plaintext teledb d+ trange Table "public.trange" Column Type Collation Nullable Default Storage Stats target Description +++++++ f1 bigint plain f2 timestamp without time zone now() plain f3 integer plain Distribute By: SHARD(f1) Location Nodes: ALL DATANODES Partition By: RANGE(f3) Of Partitions: 3 Start With: 1 Interval Of Partition: 50 teledb alter table trange add partitions 2; ALTER TABLE teledb d+ trange Table "public.trange" Column Type Collation Nullable Default Storage Stats target Description +++++++ f1 bigint plain f2 timestamp without time zone now() plain f3 integer plain Distribute By: SHARD(f1) Location Nodes: ALL DATANODES Partition By: RANGE(f3) Of Partitions: 5 Start With: 1 Interval Of Partition: 50
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        数据表管理
        添加分区子表
      • 指定模式创建表
        本文为您介绍如何指定模式创建表。 plaintext teledb create table public.t1(id int,mc text); CREATE TABLE
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        数据表管理
        指定模式创建表
      • 使用将查询结果创建数据表
        id mc + 1 teledb
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        数据表管理
        使用将查询结果创建数据表
      • 创建shard表
        本文为您介绍如何创建shard表。 不指定shard key 建表方式 不指定shard key 建表方法,系统默认使用第一个字段作为表的 shard key。 plaintext teledb create table test(id int, name varchar, birth date); CREATE TABLE teledb d+ test Table "public.test" Column Type Collation Nullable Default Storage Stats target Description +++++++ id integer plain name character varying extended birth timestamp(0) without time zone plain Distribute By: SHARD(id) Location Nodes: ALL DATANODES 分布键选择原则: 分布键只能选择一个字段。 如果有主键,则选择主键做分布键。 如果主键是复合字段组合,则选择字段值选择性多的字段做分布键。 也可以把复合字段拼接成一个新的字段来做分布键。 没有主键的可以使用UUID 来做分布键。 总之一定要让数据尽可能的分布得足够散。 指定shard key 建表方式 plaintext teledb create table testshard(id serial not null, name text) distribute by shard(name) to group defaultgroup; CREATE TABLE teledb d+ testshard Table "public.testshard" Column Type Collation Nullable Default Storage Stats target Description +++++++ id integer not null nextval('testshardidseq'::regclass) plain name text extended Distribute By: SHARD(name) Location Nodes: ALL DATANODES distribute by shard(x) 用于指定分布键,数据分布于那个节点就是根据这个字段值来计算分片。 to group xxx 用于指定存储组(每个存储组可以有多个节点)。 分布键字段值不能修改,字段长度不能修改,字段类型不能修改。
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        数据表管理
        创建shard表
      • 存储组管理
        oid groupname defaultgroup groupmembers +++ 57353 group2 0 16386 57352 group1 1 16385
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        存储组管理
      • 数据库管理
        本文为您介绍创建数据库、修改数据库配置和删除数据库。 创建数据库 要创建一个数据库,必须是一个超级用户或者具有特殊的CREATEDB特权,默认情况下,新数据库将通过克隆标准系统数据库template1被创建。可以通过写TEMPLATE name指定一个不同的模板。特别地,通过写TEMPLATE template0您可以创建一个干净的数据库,它将只包含的Teledb所预定义的标准对象。 默认参数创建数据库 plaintext teledb create database teledbdb; CREATE DATABASE 指定克隆库 plaintext teledb create database teledbdbtemplate TEMPLATE template0; CREATE DATABASE 指定所有者 plaintext teledb create role teledbuser with login; CREATE ROLE teledb create database teledbdbowner owner teledbuser; CREATE DATABASE teledb l+ teledbdbowner List of databases Name Owner Encoding Collate Ctype Access privileges Size Tablespace Description ++++++++ teledbdbowner teledbuser UTF8 zhCN.UTF8 zhCN.UTF8 19 MB pgdefault (1 row) 指定编码 plaintext teledb create database teledbdbencoding ENCODING UTF8; CREATE DATABASE teledb l+ teledbdbencoding List of databases Name Owner Encoding Collate Ctype Access privileges Size Tablespace Description ++++++++ teledbdbencoding teledb UTF8 zhCN.UTF8 zhCN.UTF8 19 MB pgdefault (1 row) 创建gbk编码 plaintext teledb
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V3.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        数据库管理
      • 修改表结构
        Column Type Collation Nullable Default Storage Stats target Description +++++++ id integer plain mc text extended 这是一条字段注释 age double precision plain
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V4.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        修改表结构
      • 多字段索引
        select from tmulidx where f11; f1 f2 f3 f4 +++ 1 1 1 1 (1 row) Time: 1.034 ms teledb select from tmulidx where f21; f1 f2 f3 f4 +++ 1 1 1 1 (1 row) Time: 37.072 ms teledb select from tmulidx where f31; f1 f2 f3 f4 +++ 1 1 1 1 (1 row) Time: 36.229 ms 单字段 plaintext teledb select from tsimpleidx where f11; f1 f2 f3 f4 +++ 1 1 1 1 (1 row) Time: 2.610 ms teledb select from tsimpleidx where f21; f1 f2 f3 f4 +++ 1 1 1 1 (1 row) Time: 3.266 ms teledb select from tsimpleidx where f31; f1 f2 f3 f4 +++ 1 1 1 1 (1 row) Time: 1.316 ms
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V4.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        索引管理
        多字段索引
      • 条件索引
        Schema Name Type Owner Table Size Allocated Size Description +++++++ public tsexsexidx index teledb tsex 14 MB 14 MB
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V4.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        索引管理
        条件索引
      • all 用法
        id nickname + 4
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V4.0.0版本产品文档
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        all 用法
      • 多表关联
        本文为您介绍SELECT语法中多表关联的使用方法。 内连接 plaintext teledb select from teledbpg inner join teledbpg1 on teledbpg.id teledbpg1.id; id nickname id nickname +++ 3 pg 3 pg (1 row) 左外连接 plaintext teledb select from teledbpg left join teledbpg1 on teledbpg.id teledbpg1.id; id nickname id nickname +++ 1 teledb 1 hello,pgxc 2 TELEDB 3 pg 3 pg 4 (5 rows) 右外连接 plaintext teledb select from teledbpg right join teledbpg1 on teledbpg.id teledbpg1.id; id nickname id nickname +++ 5 test 3 pg 3 pg (2 rows) 全连接 plaintext teledb select from teledbpg full join teledbpg1 on teledbpg.id teledbpg1.id; id nickname id nickname +++ 1 teledb 3 pg 3 pg 4 1 hello,pgxc 2 TELEDB 5 test (6 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V4.0.0版本产品文档
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        多表关联
      • 创建分区表
        Of Partitions: 12 Start With: 20170901 Interval Of Partition: 1 MONTH 说明 partion by range(xx) 代表范围分区, 支持timesamp,int类型,数据分布于那个子表就是根据这个字段值来计算分区。 begin(xx) 表示开始分区的初始值。 partition(xx) 代表初始分区数量。 step (xx) 代表分区步长。
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V4.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        数据表管理
        创建分区表
      • 创建shard表
        本文为您介绍如何创建shard表。 不指定shard key 建表方式 plaintext teledb create table testshard(id serial not null, name text) distribute by shard(name) to group defaultgroup; CREATE TABLE teledb d+ testshard Table "public.testshard" Column Type Collation Nullable Default Storage Stats target Description +++++++ id integer not null nextval('testshardidseq'::regclass) plain name text extended Distribute By: SHARD(name) Location Nodes: ALL DATANODES 分布键选择原则: 分布键只能选择一个字段。 如果有主键,则选择主键做分布键。 如果主键是复合字段组合,则选择字段值选择性多的字段做分布键。 也可以把复合字段拼接成一个新的字段来做分布键。 没有主键的可以使用UUID 来做分布键。 总之一定要让数据尽可能的分布得足够散。 指定shard key 建表方式 plaintext teledb create table testshard(id serial not null, name text) distribute by shard(name) to group defaultgroup; CREATE TABLE teledb d+ testshard Table "public.testshard" Column Type Collation Nullable Default Storage Stats target Description +++++++ id integer not null nextval('testshardidseq'::regclass) plain name text extended Distribute By: SHARD(name) Location Nodes: ALL DATANODES distribute by shard(x) 用于指定分布键,数据分布于那个节点就是根据这个字段值来计算分片。 to group xxx 用于指定存储组(每个存储组可以有多个节点)。 分布键字段值不能修改,字段长度不能修改,字段类型不能修改。
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V4.0.0版本产品文档
        开发手册
        数据库基础开发
        DDL操作
        数据表管理
        创建shard表
      • not in中包含了null,结果全为真
        本文介绍使用SELECT语法时,not in中包含了null,结果全为真的场景。 plaintext teledb select from teledbpg where id not in (1,3); id nickname + 2 TELEDB 4 (2 rows) teledb select from teledbpg where id not in (1,3,null); id nickname + (0 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品历史版本
        V4.0.0版本产品文档
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        not in中包含了null,结果全为真
      • 1
      • ...
      • 290
      • 291
      • 292
      • 293
      • 294
      • ...
      • 318
      跳转至
      推荐热词
      天翼云运维管理审计系统天翼云云服务平台云服务备份云日志服务应用运维管理云手机云电脑天翼云云hbase数据库电信云大数据saas服务电信云大数据paas服务轻量型云主机天翼云客户服务电话应用编排服务天翼云云安全解决方案云服务总线CSB天翼云服务器配置天翼云联邦学习产品天翼云云安全天翼云企业上云解决方案天翼云产品天翼云视频云存储

      天翼云最新活动

      天翼云 12.12 国云智算

      双11好价不散场,热门云主机特惠53.3元/年起!

      安全隔离版OpenClaw

      OpenClaw云服务器专属“龙虾“套餐低至3.5折起

      聚力AI赋能 天翼云大模型专项

      大模型特惠专区·Token Plan 轻享包低至9.9元起

      青云志云端助力计划

      一站式科研助手,海外资源安全访问平台,助力青年翼展宏图,平步青云

      企业出海解决方案

      助力您的业务扬帆出海,通达全球!

      天翼云信创专区

      “一云多芯、一云多态”,国产化软件全面适配,国产操作系统及硬件芯片支持丰富

      云上钜惠

      爆款云主机全场特惠,2核4G只要1.8折起!

      天翼云奖励推广计划

      加入成为云推官,推荐新用户注册下单得现金奖励

      产品推荐

      弹性云主机 ECS

      物理机 DPS

      应用云主机 ACS

      GPU云主机

      多活容灾服务 MDR

      镜像服务 IMS

      弹性伸缩服务 AS

      弹性高性能计算 E-HPC

      训推服务

      推荐文档

      支持的监控指标

      首次使用——开通账号

      上传资料常见问题

      代码示例

      【2019】633号关于调整非经营性互联网信息服务备案编号的通知

      慢日志查询

      卸载

      监控应用运行状态

      如何充值?

      • 7*24小时售后
      • 无忧退款
      • 免费备案
      • 专家服务
      售前咨询热线
      400-810-9889转1
      关注天翼云
      • 旗舰店
      • 天翼云APP
      • 天翼云微信公众号
      服务与支持
      • 备案中心
      • 售前咨询
      • 智能客服
      • 自助服务
      • 工单管理
      • 客户公告
      • 涉诈举报
      账户管理
      • 管理中心
      • 订单管理
      • 余额管理
      • 发票管理
      • 充值汇款
      • 续费管理
      快速入口
      • 天翼云旗舰店
      • 文档中心
      • 最新活动
      • 免费试用
      • 信任中心
      • 天翼云学堂
      云网生态
      • 甄选商城
      • 渠道合作
      • 云市场合作
      了解天翼云
      • 关于天翼云
      • 天翼云APP
      • 服务案例
      • 新闻资讯
      • 联系我们
      热门产品
      • 云电脑
      • 弹性云主机
      • 云电脑政企版
      • 天翼云手机
      • 云数据库
      • 对象存储
      • 云硬盘
      • Web应用防火墙
      • 息壤智算平台
      • CDN加速
      热门推荐
      • 云服务备份
      • 边缘安全加速平台
      • 全站加速
      • 安全加速
      • 云服务器
      • 云主机
      • 智能边缘云
      • 应用编排服务
      • 微服务引擎
      • 共享流量包
      更多推荐
      • web应用防火墙
      • 密钥管理
      • 等保咨询
      • 安全专区
      • 应用运维管理
      • 云日志服务
      • 文档数据库服务
      • 云搜索服务
      • 数据湖探索
      • 数据仓库服务
      友情链接
      • 中国电信集团
      • 天翼云国际站
      • 189邮箱
      • 天翼企业云盘
      • 天翼云盘
      ©2026 天翼云科技有限公司版权所有 增值电信业务经营许可证A2.B1.B2-20090001
      公司地址:北京市东城区青龙胡同甲1号、3号2幢2层205-32室
      • 用户协议
      • 隐私政策
      • 个人信息保护
      • 法律声明
      备案 京公网安备11010802043424号 京ICP备 2021034386号