- 最新动态
- 功能总览
- 服务公告
- 产品介绍
- 计费说明
- 快速入门
-
管理指南
- GaussDB(DWS)使用流程
- 准备工作
- 创建GaussDB(DWS)集群
- 连接GaussDB(DWS)集群
- 创建GaussDB(DWS)数据库和用户
- 迁移业务数据至GaussDB(DWS)集群
- GaussDB(DWS)集群数据安全与加密
- GaussDB(DWS)集群管理
-
GaussDB(DWS)集群运维
- 在监控面板(DMS)查看GaussDB(DWS)集群监控
- 在Cloud Eye查看GaussDB(DWS)集群监控
- 监控并诊断GaussDB(DWS)集群TopSQL
-
查看GaussDB(DWS)集群告警
- 告警管理简介
- 告警规则
- 订阅告警通知
-
告警处理
- DWS_2000000001 节点CPU使用率超阈值(Node CPU Usage Exceeds the Threshold)
- DWS_2000000006 节点数据盘使用率超阈值(Node Data Disk Usage Exceeds the Threshold)
- DWS_2000000009 节点数据盘I/O利用率超阈值(Node Data Disk I/O Usage Exceeds the Threshold)
- DWS_2000000012 节点数据盘时延超阈值(Node Data Disk Latency Exceeds the Threshold)
- DWS_2000000016 查询语句触发下盘量超阈值(Data Spilled to Disks for a Query Statement Exceeds the Threshold)
- DWS_2000000017 查询语句堆积数量超阈值(Number of Queuing Query Statements Exceeds the Threshold)
- DWS_2000000018 集群默认资源池队列阻塞(Queue congestion in the cluster default resource pool)
- DWS_2000000020 集群的SQL探针耗时超阈值(SQL probe of the cluster Usage Exceeds the Threshold)
- DWS_2000000023 集群中存在持有锁过长的vacuum full操作(Vacuum Full Operation That Holds A Table Lock Exceeds the Threshold)
- DWS_2000000027 DWS集群节点实例内存使用率超阈值(The process memory usage in the data warehouse cluster exceeds the threshold)
- DWS_2000000028 DWS集群节点动态内存使用率超阈值(The dynamic memory usage in the data warehouse cluster exceeds the threshold)
- 查看并订阅GaussDB(DWS)集群事件
- GaussDB(DWS)常用运维命令集
- 备份与恢复GaussDB(DWS)集群
- GaussDB(DWS)集群节点扩缩容
- GaussDB(DWS)集群规格变更
- GaussDB(DWS)集群容灾管理
- GaussDB(DWS)集群升级
- GaussDB(DWS)集群日志管理
- GaussDB(DWS)集群状态异常操作
- Vacuum回收GaussDB(DWS)空间
- 授权GaussDB(DWS)集群运维账号
-
最佳实践
- 导入导出
- 数据迁移
- 数据分析
- 存算分离
- 数据开发
- 数据库管理
- 性能调优
- 集群管理
- 数据迁移与同步
-
开发指南
-
标准数仓开发指南(9.1.0.x)
- 使用前必读
- GaussDB(DWS)开发设计建议
- 创建和管理GaussDB(DWS)数据库对象
- Oracle、Teradata和MySQL语法兼容性差异
- GaussDB(DWS)数据库安全管理
- 查询GaussDB(DWS)数据
- GaussDB(DWS)排序规则
- GaussDB(DWS)用户自定义函数
- GaussDB(DWS)存储过程
- 使用PostGIS Extension
- 使用JDBC或ODBC进行GaussDB(DWS)二次开发
- GaussDB(DWS)资源监控
- GaussDB(DWS)性能调优
-
GaussDB(DWS)系统表和系统视图
- 系统表和系统视图概述
-
系统表
- GS_BLOCKLIST_QUERY
- GS_BLOCKLIST_SQL
- GS_OBSSCANINFO
- GS_RESPOOL_RESOURCE_HISTORY
- GS_WLM_INSTANCE_HISTORY
- GS_WLM_OPERATOR_INFO
- GS_WLM_SESSION_INFO
- GS_WLM_USER_RESOURCE_HISTORY
- PG_AGGREGATE
- PG_AM
- PG_AMOP
- PG_AMPROC
- PG_ATTRDEF
- PG_ATTRIBUTE
- PG_AUTHID
- PG_AUTH_HISTORY
- PG_AUTH_MEMBERS
- PG_BLOCKLISTS
- PG_CAST
- PG_CLASS
- PG_COLLATION
- PG_CONSTRAINT
- PG_CONVERSION
- PG_DATABASE
- PG_DB_ROLE_SETTING
- PG_DEFAULT_ACL
- PG_DEPEND
- PG_DESCRIPTION
- PG_ENUM
- PG_EXCEPT_RULE
- PG_EXTERNAL_NAMESPACE
- PG_EXTENSION
- PG_EXTENSION_DATA_SOURCE
- PG_FINE_DR_INFO
- PG_FOREIGN_DATA_WRAPPER
- PG_FOREIGN_SERVER
- PG_FOREIGN_TABLE
- PG_INDEX
- PG_INHERITS
- PG_JOB_INFO
- PG_JOBS
- PG_LANGUAGE
- PG_LARGEOBJECT
- PG_LARGEOBJECT_METADATA
- PG_MATVIEW
- PG_NAMESPACE
- PG_OBJECT
- PG_OBSSCANINFO
- PG_OPCLASS
- PG_OPERATOR
- PG_OPFAMILY
- PG_PARTITION
- PG_PLTEMPLATE
- PG_PROC
- PG_PUBLICATION
- PG_PUBLICATION_NAMESPACE
- PG_PUBLICATION_REL
- PG_RANGE
- PG_REDACTION_COLUMN
- PG_REDACTION_POLICY
- PG_RELFILENODE_SIZE
- PG_RLSPOLICY
- PG_RESOURCE_POOL
- PG_REWRITE
- PG_SECLABEL
- PG_SHDEPEND
- PG_SHDESCRIPTION
- PG_SHSECLABEL
- PG_STATISTIC
- PG_STATISTIC_EXT
- PG_STAT_OBJECT
- PG_SUBSCRIPTION
- PG_SYNONYM
- PG_TABLESPACE
- PG_TRIGGER
- PG_TS_CONFIG
- PG_TS_CONFIG_MAP
- PG_TS_DICT
- PG_TS_PARSER
- PG_TS_TEMPLATE
- PG_TYPE
- PG_USER_MAPPING
- PG_USER_STATUS
- PG_WORKLOAD_ACTION
- PGXC_CLASS
- PGXC_GROUP
- PGXC_NODE
- PLAN_TABLE_DATA
- SNAPSHOT
- TABLES_SNAP_TIMESTAMP
- 性能视图快照系统表
-
系统视图
- ALL_ALL_TABLES
- ALL_CONSTRAINTS
- ALL_CONS_COLUMNS
- ALL_COL_COMMENTS
- ALL_DEPENDENCIES
- ALL_IND_COLUMNS
- ALL_IND_EXPRESSIONS
- ALL_INDEXES
- ALL_OBJECTS
- ALL_PROCEDURES
- ALL_SEQUENCES
- ALL_SOURCE
- ALL_SYNONYMS
- ALL_TAB_COLUMNS
- ALL_TAB_COMMENTS
- ALL_TABLES
- ALL_USERS
- ALL_VIEWS
- DBA_DATA_FILES
- DBA_USERS
- DBA_COL_COMMENTS
- DBA_CONSTRAINTS
- DBA_CONS_COLUMNS
- DBA_IND_COLUMNS
- DBA_IND_EXPRESSIONS
- DBA_IND_PARTITIONS
- DBA_INDEXES
- DBA_OBJECTS
- DBA_PART_INDEXES
- DBA_PART_TABLES
- DBA_PROCEDURES
- DBA_SEQUENCES
- DBA_SOURCE
- DBA_SYNONYMS
- DBA_TAB_COLUMNS
- DBA_TAB_COMMENTS
- DBA_TAB_PARTITIONS
- DBA_TABLES
- DBA_TABLESPACES
- DBA_TRIGGERS
- DBA_VIEWS
- DUAL
- GET_ALL_TSC_INFO
- GET_TSC_INFO
- GLOBAL_COLUMN_TABLE_IO_STAT
- GLOBAL_REDO_STAT
- GLOBAL_REL_IOSTAT
- GLOBAL_ROW_TABLE_IO_STAT
- GLOBAL_STAT_DATABASE
- GLOBAL_TABLE_CHANGE_STAT
- GLOBAL_TABLE_STAT
- GLOBAL_WORKLOAD_SQL_COUNT
- GLOBAL_WORKLOAD_SQL_ELAPSE_TIME
- GLOBAL_WORKLOAD_TRANSACTION
- GS_ALL_CONTROL_GROUP_INFO
- GS_BLOCKLIST_QUERY
- GS_BLOCKLIST_SQL
- GS_CLUSTER_RESOURCE_INFO
- GS_COLUMN_TABLE_IO_STAT
- GS_OBS_READ_TRAFFIC
- GS_OBS_WRITE_TRAFFIC
- GS_INSTR_UNIQUE_SQL
- GS_NODE_STAT_RESET_TIME
- GS_OBS_LATENCY
- GS_QUERY_MONITOR
- GS_QUERY_RESOURCE_INFO
- GS_REL_IOSTAT
- GS_RESPOOL_RUNTIME_INFO
- GS_RESPOOL_RESOURCE_INFO
- GS_RESPOOL_MONITOR
- GS_ROW_TABLE_IO_STAT
- GS_SESSION_CPU_STATISTICS
- GS_SESSION_MEMORY_STATISTICS
- GS_SQL_COUNT
- GS_STAT_DB_CU
- GS_STAT_SESSION_CU
- GS_TABLE_CHANGE_STAT
- GS_TABLE_STAT
- GS_TOTAL_NODEGROUP_MEMORY_DETAIL
- GS_USER_MONITOR
- GS_USER_TRANSACTION
- GS_VIEW_DEPENDENCY
- GS_VIEW_DEPENDENCY_PATH
- GS_VIEW_INVALID
- GS_WAIT_EVENTS
- GS_WLM_OPERAROR_INFO
- GS_WLM_OPERATOR_HISTORY
- GS_WLM_OPERATOR_STATISTICS
- GS_WLM_SESSION_INFO
- GS_WLM_SESSION_HISTORY
- GS_WLM_SESSION_STATISTICS
- GS_WLM_SQL_ALLOW
- GS_WORKLOAD_SQL_COUNT
- GS_WORKLOAD_SQL_ELAPSE_TIME
- GS_WORKLOAD_TRANSACTION
- MPP_TABLES
- PG_AVAILABLE_EXTENSION_VERSIONS
- PG_AVAILABLE_EXTENSIONS
- PG_BULKLOAD_STATISTICS
- PG_COMM_CLIENT_INFO
- PG_COMM_DELAY
- PG_COMM_STATUS
- PG_COMM_RECV_STREAM
- PG_COMM_SEND_STREAM
- PG_COMM_QUERY_SPEED
- PG_CONTROL_GROUP_CONFIG
- PG_CURSORS
- PG_EXT_STATS
- PG_GET_INVALID_BACKENDS
- PG_GET_SENDERS_CATCHUP_TIME
- PG_GLOBAL_TEMP_ATTACHED_PIDS
- PG_GROUP
- PG_INDEXES
- PG_JOB
- PG_JOB_PROC
- PG_JOB_SINGLE
- PG_LIFECYCLE_DATA_DISTRIBUTE
- PG_LOCKS
- PG_LWLOCKS
- PG_NODE_ENV
- PG_OS_THREADS
- PG_POOLER_STATUS
- PG_PREPARED_STATEMENTS
- PG_PREPARED_XACTS
- PG_PUBLICATION_TABLES
- PG_QUERYBAND_ACTION
- PG_REPLICATION_SLOTS
- PG_ROLES
- PG_RULES
- PG_RUNNING_XACTS
- PG_SECLABELS
- PG_SEQUENCES
- PG_SESSION_WLMSTAT
- PG_SESSION_IOSTAT
- PG_SETTINGS
- PG_SHADOW
- PG_SHARED_MEMORY_DETAIL
- PG_STATS
- PG_STAT_ACTIVITY
- PG_STAT_ALL_INDEXES
- PG_STAT_ALL_TABLES
- PG_STAT_BAD_BLOCK
- PG_STAT_BGWRITER
- PG_STAT_DATABASE
- PG_STAT_DATABASE_CONFLICTS
- PG_STAT_GET_MEM_MBYTES_RESERVED
- PG_STAT_USER_FUNCTIONS
- PG_STAT_USER_INDEXES
- PG_STAT_USER_TABLES
- PG_STAT_REPLICATION
- PG_STAT_SYS_INDEXES
- PG_STAT_SYS_TABLES
- PG_STAT_XACT_ALL_TABLES
- PG_STAT_XACT_SYS_TABLES
- PG_STAT_XACT_USER_FUNCTIONS
- PG_STAT_XACT_USER_TABLES
- PG_STATIO_ALL_INDEXES
- PG_STATIO_ALL_SEQUENCES
- PG_STATIO_ALL_TABLES
- PG_STATIO_SYS_INDEXES
- PG_STATIO_SYS_SEQUENCES
- PG_STATIO_SYS_TABLES
- PG_STATIO_USER_INDEXES
- PG_STATIO_USER_SEQUENCES
- PG_STATIO_USER_TABLES
- PG_THREAD_WAIT_STATUS
- PG_TABLES
- PG_TDE_INFO
- PG_TIMEZONE_ABBREVS
- PG_TIMEZONE_NAMES
- PG_TOTAL_MEMORY_DETAIL
- PG_TOTAL_SCHEMA_INFO
- PG_TOTAL_USER_RESOURCE_INFO
- PG_USER
- PG_USER_MAPPINGS
- PG_VIEWS
- PG_WLM_STATISTICS
- PGXC_AIO_RESOURCE_POOL_STATS
- PGXC_BULKLOAD_PROGRESS
- PGXC_BULKLOAD_INFO
- PGXC_BULKLOAD_STATISTICS
- PGXC_COLUMN_TABLE_IO_STAT
- PGXC_COMM_CLIENT_INFO
- PGXC_COMM_DELAY
- PGXC_COMM_RECV_STREAM
- PGXC_COMM_SEND_STREAM
- PGXC_COMM_STATUS
- PGXC_COMM_QUERY_SPEED
- PGXC_DEADLOCK
- PGXC_DISK_CACHE_STATS
- PGXC_DISK_CACHE_ALL_STATS
- PGXC_DISK_CACHE_PATH_INFO
- PGXC_GET_STAT_ALL_TABLES
- PGXC_GET_STAT_ALL_PARTITIONS
- PGXC_GET_TABLE_SKEWNESS
- PGXC_GLOBAL_TEMP_ATTACHED_PIDS
- PGXC_GTM_SNAPSHOT_STATUS
- PGXC_INSTANCE_TIME
- PGXC_LOCKWAIT_DETAIL
- PGXC_INSTR_UNIQUE_SQL
- PGXC_LOCK_CONFLICTS
- PGXC_LWLOCKS
- PGXC_MEMORY_DEBUG_INFO
- PGXC_NODE_ENV
- PGXC_NODE_STAT_RESET_TIME
- PGXC_OBS_IO_SCHEDULER_STATS
- PGXC_OBS_IO_SCHEDULER_PERIODIC_STATS
- PGXC_OS_RUN_INFO
- PGXC_OS_THREADS
- PGXC_POOLER_STATUS
- PGXC_PREPARED_XACTS
- PGXC_REDO_STAT
- PGXC_REL_IOSTAT
- PGXC_REPLICATION_SLOTS
- PGXC_RESPOOL_RUNTIME_INFO
- PGXC_RESPOOL_RESOURCE_INFO
- PGXC_RESPOOL_RESOURCE_HISTORY
- PGXC_ROW_TABLE_IO_STAT
- PGXC_RUNNING_XACTS
- PGXC_SETTINGS
- PGXC_SESSION_WLMSTAT
- PGXC_STAT_ACTIVITY
- PGXC_STAT_BAD_BLOCK
- PGXC_STAT_BGWRITER
- PGXC_STAT_DATABASE
- PGXC_STAT_OBJECT
- PGXC_STAT_REPLICATION
- PGXC_STAT_TABLE_DIRTY
- PGXC_STAT_WAL
- PGXC_SQL_COUNT
- PGXC_TABLE_CHANGE_STAT
- PGXC_TABLE_STAT
- PGXC_THREAD_WAIT_STATUS
- PGXC_TOTAL_MEMORY_DETAIL
- PGXC_TOTAL_SCHEMA_INFO
- PGXC_TOTAL_SCHEMA_INFO_ANALYZE
- PGXC_TOTAL_USER_RESOURCE_INFO
- PGXC_USER_TRANSACTION
- PGXC_VARIABLE_INFO
- PGXC_WAIT_DETAIL
- PGXC_WAIT_EVENTS
- PGXC_WLM_OPERATOR_HISTORY
- PGXC_WLM_OPERATOR_INFO
- PGXC_WLM_OPERATOR_STATISTICS
- PGXC_WLM_SESSION_INFO
- PGXC_WLM_SESSION_HISTORY
- PGXC_WLM_SESSION_STATISTICS
- PGXC_WLM_TABLE_DISTRIBUTION_SKEWNESS
- PGXC_WLM_USER_RESOURCE_HISTORY
- PGXC_WLM_WORKLOAD_RECORDS
- PGXC_WORKLOAD_SQL_COUNT
- PGXC_WORKLOAD_SQL_ELAPSE_TIME
- PGXC_WORKLOAD_TRANSACTION
- PLAN_TABLE
- PV_FILE_STAT
- PV_INSTANCE_TIME
- PV_MATVIEW_DETAIL
- PV_OS_RUN_INFO
- PV_SESSION_MEMORY
- PV_SESSION_MEMORY_DETAIL
- PV_SESSION_STAT
- PV_SESSION_TIME
- PV_TOTAL_MEMORY_DETAIL
- PV_REDO_STAT
- PV_RUNTIME_ATTSTATS
- PV_RUNTIME_RELSTATS
- REDACTION_COLUMNS
- REDACTION_POLICIES
- REMOTE_TABLE_STAT
- SHOW_TSC_INFO
- SHOW_ALL_TSC_INFO
- USER_COL_COMMENTS
- USER_CONSTRAINTS
- USER_CONS_COLUMNS
- USER_INDEXES
- USER_IND_COLUMNS
- USER_IND_EXPRESSIONS
- USER_IND_PARTITIONS
- USER_JOBS
- USER_OBJECTS
- USER_PART_INDEXES
- USER_PART_TABLES
- USER_PROCEDURES
- USER_SEQUENCES
- USER_SOURCE
- USER_SYNONYMS
- USER_TAB_COLUMNS
- USER_TAB_COMMENTS
- USER_TAB_PARTITIONS
- USER_TABLES
- USER_TRIGGERS
- USER_VIEWS
- V$SESSION
- V$SESSION_LONGOPS
- GaussDB(DWS)数据库GUC参数
- GaussDB(DWS)开发者术语表
-
标准数仓开发指南(8.1.3.x)
- 使用前必读
- GaussDB(DWS)开发设计规范
- 创建和管理GaussDB(DWS)数据库对象
- Oracle、Teradata和MySQL语法兼容性差异
- GaussDB(DWS)数据库安全管理
- 查询GaussDB(DWS)数据
- GaussDB(DWS)排序规则
- GaussDB(DWS)用户自定义函数
- GaussDB(DWS)存储过程
- 使用PostGIS Extension
- 使用JDBC或ODBC进行GaussDB(DWS)二次开发
- GaussDB(DWS)资源监控
- GaussDB(DWS)性能调优
-
GaussDB(DWS)系统表和系统视图
- 系统表和系统视图概述
-
系统表
- GS_OBSSCANINFO
- GS_RESPOOL_RESOURCE_HISTORY
- GS_WLM_INSTANCE_HISTORY
- GS_WLM_OPERATOR_INFO
- GS_WLM_SESSION_INFO
- GS_WLM_USER_RESOURCE_HISTORY
- PG_AGGREGATE
- PG_AM
- PG_AMOP
- PG_AMPROC
- PG_ATTRDEF
- PG_ATTRIBUTE
- PG_AUTHID
- PG_AUTH_HISTORY
- PG_AUTH_MEMBERS
- PG_CAST
- PG_CLASS
- PG_COLLATION
- PG_CONSTRAINT
- PG_CONVERSION
- PG_DATABASE
- PG_DB_ROLE_SETTING
- PG_DEFAULT_ACL
- PG_DEPEND
- PG_DESCRIPTION
- PG_ENUM
- PG_EXTENSION
- PG_EXTENSION_DATA_SOURCE
- PG_FOREIGN_DATA_WRAPPER
- PG_FOREIGN_SERVER
- PG_FOREIGN_TABLE
- PG_INDEX
- PG_INHERITS
- PG_JOBS
- PG_LANGUAGE
- PG_LARGEOBJECT
- PG_LARGEOBJECT_METADATA
- PG_NAMESPACE
- PG_OBJECT
- PG_OBSSCANINFO
- PG_OPCLASS
- PG_OPERATOR
- PG_OPFAMILY
- PG_PARTITION
- PG_PLTEMPLATE
- PG_PROC
- PG_RANGE
- PG_REDACTION_COLUMN
- PG_REDACTION_POLICY
- PG_RELFILENODE_SIZE
- PG_RLSPOLICY
- PG_RESOURCE_POOL
- PG_REWRITE
- PG_SECLABEL
- PG_SHDEPEND
- PG_SHDESCRIPTION
- PG_SHSECLABEL
- PG_STATISTIC
- PG_STATISTIC_EXT
- PG_SYNONYM
- PG_TABLESPACE
- PG_TRIGGER
- PG_TS_CONFIG
- PG_TS_CONFIG_MAP
- PG_TS_DICT
- PG_TS_PARSER
- PG_TS_TEMPLATE
- PG_TYPE
- PG_USER_MAPPING
- PG_USER_STATUS
- PG_WORKLOAD_ACTION
- PGXC_CLASS
- PGXC_GROUP
- PGXC_NODE
- PLAN_TABLE_DATA
- SNAPSHOT
- TABLES_SNAP_TIMESTAMP
- 性能视图快照系统表
-
系统视图
- ALL_ALL_TABLES
- ALL_CONSTRAINTS
- ALL_CONS_COLUMNS
- ALL_COL_COMMENTS
- ALL_DEPENDENCIES
- ALL_IND_COLUMNS
- ALL_IND_EXPRESSIONS
- ALL_INDEXES
- ALL_OBJECTS
- ALL_PROCEDURES
- ALL_SEQUENCES
- ALL_SOURCE
- ALL_SYNONYMS
- ALL_TAB_COLUMNS
- ALL_TAB_COMMENTS
- ALL_TABLES
- ALL_USERS
- ALL_VIEWS
- DBA_DATA_FILES
- DBA_USERS
- DBA_COL_COMMENTS
- DBA_CONSTRAINTS
- DBA_CONS_COLUMNS
- DBA_IND_COLUMNS
- DBA_IND_EXPRESSIONS
- DBA_IND_PARTITIONS
- DBA_INDEXES
- DBA_OBJECTS
- DBA_PART_INDEXES
- DBA_PART_TABLES
- DBA_PROCEDURES
- DBA_SEQUENCES
- DBA_SOURCE
- DBA_SYNONYMS
- DBA_TAB_COLUMNS
- DBA_TAB_COMMENTS
- DBA_TAB_PARTITIONS
- DBA_TABLES
- DBA_TABLESPACES
- DBA_TRIGGERS
- DBA_VIEWS
- DUAL
- GLOBAL_COLUMN_TABLE_IO_STAT
- GLOBAL_REDO_STAT
- GLOBAL_REL_IOSTAT
- GLOBAL_ROW_TABLE_IO_STAT
- GLOBAL_STAT_DATABASE
- GLOBAL_TABLE_CHANGE_STAT
- GLOBAL_TABLE_STAT
- GLOBAL_WORKLOAD_SQL_COUNT
- GLOBAL_WORKLOAD_SQL_ELAPSE_TIME
- GLOBAL_WORKLOAD_TRANSACTION
- GS_ALL_CONTROL_GROUP_INFO
- GS_CLUSTER_RESOURCE_INFO
- GS_COLUMN_TABLE_IO_STAT
- GS_INSTR_UNIQUE_SQL
- GS_NODE_STAT_RESET_TIME
- GS_REL_IOSTAT
- GS_RESPOOL_RUNTIME_INFO
- GS_RESPOOL_RESOURCE_INFO
- GS_ROW_TABLE_IO_STAT
- GS_SESSION_CPU_STATISTICS
- GS_SESSION_MEMORY_STATISTICS
- GS_SQL_COUNT
- GS_STAT_DB_CU
- GS_STAT_SESSION_CU
- GS_TABLE_CHANGE_STAT
- GS_TABLE_STAT
- GS_TOTAL_NODEGROUP_MEMORY_DETAIL
- GS_USER_TRANSACTION
- GS_VIEW_DEPENDENCY
- GS_VIEW_DEPENDENCY_PATH
- GS_VIEW_INVALID
- GS_WAIT_EVENTS
- GS_WLM_OPERAROR_INFO
- GS_WLM_OPERATOR_HISTORY
- GS_WLM_OPERATOR_STATISTICS
- GS_WLM_SESSION_INFO
- GS_WLM_SESSION_HISTORY
- GS_WLM_SESSION_STATISTICS
- GS_WLM_SQL_ALLOW
- GS_WORKLOAD_SQL_COUNT
- GS_WORKLOAD_SQL_ELAPSE_TIME
- GS_WORKLOAD_TRANSACTION
- MPP_TABLES
- PG_AVAILABLE_EXTENSION_VERSIONS
- PG_AVAILABLE_EXTENSIONS
- PG_BULKLOAD_STATISTICS
- PG_COMM_CLIENT_INFO
- PG_COMM_DELAY
- PG_COMM_STATUS
- PG_COMM_RECV_STREAM
- PG_COMM_SEND_STREAM
- PG_COMM_QUERY_SPEED
- PG_CONTROL_GROUP_CONFIG
- PG_CURSORS
- PG_EXT_STATS
- PG_GET_INVALID_BACKENDS
- PG_GET_SENDERS_CATCHUP_TIME
- PG_GROUP
- PG_INDEXES
- PG_JOB
- PG_JOB_PROC
- PG_JOB_SINGLE
- PG_LIFECYCLE_DATA_DISTRIBUTE
- PG_LOCKS
- PG_NODE_ENV
- PG_OS_THREADS
- PG_POOLER_STATUS
- PG_PREPARED_STATEMENTS
- PG_PREPARED_XACTS
- PG_QUERYBAND_ACTION
- PG_REPLICATION_SLOTS
- PG_ROLES
- PG_RULES
- PG_RUNNING_XACTS
- PG_SECLABELS
- PG_SESSION_WLMSTAT
- PG_SESSION_IOSTAT
- PG_SETTINGS
- PG_SHADOW
- PG_SHARED_MEMORY_DETAIL
- PG_STATS
- PG_STAT_ACTIVITY
- PG_STAT_ALL_INDEXES
- PG_STAT_ALL_TABLES
- PG_STAT_BAD_BLOCK
- PG_STAT_BGWRITER
- PG_STAT_DATABASE
- PG_STAT_DATABASE_CONFLICTS
- PG_STAT_GET_MEM_MBYTES_RESERVED
- PG_STAT_USER_FUNCTIONS
- PG_STAT_USER_INDEXES
- PG_STAT_USER_TABLES
- PG_STAT_REPLICATION
- PG_STAT_SYS_INDEXES
- PG_STAT_SYS_TABLES
- PG_STAT_XACT_ALL_TABLES
- PG_STAT_XACT_SYS_TABLES
- PG_STAT_XACT_USER_FUNCTIONS
- PG_STAT_XACT_USER_TABLES
- PG_STATIO_ALL_INDEXES
- PG_STATIO_ALL_SEQUENCES
- PG_STATIO_ALL_TABLES
- PG_STATIO_SYS_INDEXES
- PG_STATIO_SYS_SEQUENCES
- PG_STATIO_SYS_TABLES
- PG_STATIO_USER_INDEXES
- PG_STATIO_USER_SEQUENCES
- PG_STATIO_USER_TABLES
- PG_THREAD_WAIT_STATUS
- PG_TABLES
- PG_TDE_INFO
- PG_TIMEZONE_ABBREVS
- PG_TIMEZONE_NAMES
- PG_TOTAL_MEMORY_DETAIL
- PG_TOTAL_SCHEMA_INFO
- PG_TOTAL_USER_RESOURCE_INFO
- PG_USER
- PG_USER_MAPPINGS
- PG_VIEWS
- PG_WLM_STATISTICS
- PGXC_BULKLOAD_PROGRESS
- PGXC_BULKLOAD_STATISTICS
- PGXC_COLUMN_TABLE_IO_STAT
- PGXC_COMM_CLIENT_INFO
- PGXC_COMM_DELAY
- PGXC_COMM_RECV_STREAM
- PGXC_COMM_SEND_STREAM
- PGXC_COMM_STATUS
- PGXC_COMM_QUERY_SPEED
- PGXC_DEADLOCK
- PGXC_GET_STAT_ALL_TABLES
- PGXC_GET_STAT_ALL_PARTITIONS
- PGXC_GET_TABLE_SKEWNESS
- PGXC_GTM_SNAPSHOT_STATUS
- PGXC_INSTANCE_TIME
- PGXC_LOCKWAIT_DETAIL
- PGXC_INSTR_UNIQUE_SQL
- PGXC_LOCK_CONFLICTS
- PGXC_NODE_ENV
- PGXC_NODE_STAT_RESET_TIME
- PGXC_OS_RUN_INFO
- PGXC_OS_THREADS
- PGXC_PREPARED_XACTS
- PGXC_REDO_STAT
- PGXC_REL_IOSTAT
- PGXC_REPLICATION_SLOTS
- PGXC_RESPOOL_RUNTIME_INFO
- PGXC_RESPOOL_RESOURCE_INFO
- PGXC_RESPOOL_RESOURCE_HISTORY
- PGXC_ROW_TABLE_IO_STAT
- PGXC_RUNNING_XACTS
- PGXC_SETTINGS
- PGXC_SESSION_WLMSTAT
- PGXC_STAT_ACTIVITY
- PGXC_STAT_BAD_BLOCK
- PGXC_STAT_BGWRITER
- PGXC_STAT_DATABASE
- PGXC_STAT_REPLICATION
- PGXC_STAT_TABLE_DIRTY
- PGXC_SQL_COUNT
- PGXC_TABLE_CHANGE_STAT
- PGXC_TABLE_STAT
- PGXC_THREAD_WAIT_STATUS
- PGXC_TOTAL_MEMORY_DETAIL
- PGXC_TOTAL_SCHEMA_INFO
- PGXC_TOTAL_SCHEMA_INFO_ANALYZE
- PGXC_USER_TRANSACTION
- PGXC_VARIABLE_INFO
- PGXC_WAIT_DETAIL
- PGXC_WAIT_EVENTS
- PGXC_WLM_OPERATOR_HISTORY
- PGXC_WLM_OPERATOR_INFO
- PGXC_WLM_OPERATOR_STATISTICS
- PGXC_WLM_SESSION_INFO
- PGXC_WLM_SESSION_HISTORY
- PGXC_WLM_SESSION_STATISTICS
- PGXC_WLM_WORKLOAD_RECORDS
- PGXC_WORKLOAD_SQL_COUNT
- PGXC_WORKLOAD_SQL_ELAPSE_TIME
- PGXC_WORKLOAD_TRANSACTION
- PLAN_TABLE
- PV_FILE_STAT
- PV_INSTANCE_TIME
- PV_OS_RUN_INFO
- PV_SESSION_MEMORY
- PV_SESSION_MEMORY_DETAIL
- PV_SESSION_STAT
- PV_SESSION_TIME
- PV_TOTAL_MEMORY_DETAIL
- PV_REDO_STAT
- REDACTION_COLUMNS
- REDACTION_POLICIES
- REMOTE_TABLE_STAT
- USER_COL_COMMENTS
- USER_CONSTRAINTS
- USER_CONS_COLUMNS
- USER_INDEXES
- USER_IND_COLUMNS
- USER_IND_EXPRESSIONS
- USER_IND_PARTITIONS
- USER_JOBS
- USER_OBJECTS
- USER_PART_INDEXES
- USER_PART_TABLES
- USER_PROCEDURES
- USER_SEQUENCES
- USER_SOURCE
- USER_SYNONYMS
- USER_TAB_COLUMNS
- USER_TAB_COMMENTS
- USER_TAB_PARTITIONS
- USER_TABLES
- USER_TRIGGERS
- USER_VIEWS
- V$SESSION
- V$SESSION_LONGOPS
- GaussDB(DWS)数据库GUC参数
- GaussDB(DWS)开发者术语表
- 实时数仓开发指南(9.1.0.x)
- 实时数仓开发指南(8.1.3.x)
- 历史版本
-
标准数仓开发指南(9.1.0.x)
-
SQL语法参考
-
SQL语法参考(9.1.0.x)
- GaussDB(DWS) SQL概述
- 与PostgreSQL的差异
- 关键字
- 数据类型
- 常量与宏
-
函数和操作符
- 字符处理函数和操作符
- 二进制字符串函数和操作符
- 位串函数和操作符
- 数字操作函数和操作符
- 时间、日期处理函数和操作符
- SEQUENCE函数
- 数组函数和操作符
- 逻辑操作符
- 比较操作符
- 模式匹配操作符
- 聚集函数
- 窗口函数
- 类型转换函数
- JSON/JSONB函数和操作符
- 安全函数
- 条件表达式函数
- 范围函数和操作符
- 数据脱敏函数
- 位图函数和操作符
- UUID函数
- 文本检索函数和操作符
- HLL函数和操作符
- 返回集合的函数
- 几何函数和操作符
- 网络地址函数和操作符
- 系统信息函数
- 系统管理函数
- 备份恢复控制函数
- 数据库对象函数
- 残留文件管理函数
- 统计信息函数
- 触发器函数
- XML函数
- 调用栈记录函数
- Hudi系统函数
- 漏斗和留存函数
- EXTERNAL SCHEMA系统函数
- 存算分离函数
- 表达式
- 类型转换
- 全文检索
- 系统操作
- 事务管理
-
DDL语法
- DDL语法一览表
- ALTER BLOCK RULE
- ALTER DATABASE
- ALTER EXCEPT RULE
- ALTER EXTERNAL SCHEMA
- ALTER FOREIGN TABLE (GDS导入导出)
- ALTER FOREIGN TABLE (For HDFS or OBS)
- ALTER FOREIGN TABLE (SQL on other GaussDB(DWS))
- ALTER FUNCTION
- ALTER GROUP
- ALTER INDEX
- ALTER LARGE OBJECT
- ALTER MATERIALIZED VIEW
- ALTER PUBLICATION
- ALTER REDACTION POLICY
- ALTER RESOURCE POOL
- ALTER ROLE
- ALTER SUBSCRIPTION
- ALTER ROW LEVEL SECURITY POLICY
- ALTER SCHEMA
- ALTER SEQUENCE
- ALTER SERVER
- ALTER SESSION
- ALTER SYNONYM
- ALTER SYSTEM KILL SESSION
- ALTER TABLE
- ALTER TABLE PARTITION
- ALTER TEXT SEARCH CONFIGURATION
- ALTER TEXT SEARCH DICTIONARY
- ALTER TRIGGER
- ALTER TYPE
- ALTER USER
- ALTER VIEW
- CLEAN CONNECTION
- CLOSE
- CLUSTER
- COMMENT
- CREATE BARRIER
- CREATE BLOCK RULE
- CREATE DATABASE
- CREATE EXCEPT RULE
- CREATE EXTERNAL SCHEMA
- CREATE FOREIGN TABLE (GDS导入导出)
- CREATE FOREIGN TABLE (SQL on OBS or Hadoop)
- CREATE FOREIGN TABLE (OBS导入导出)
- CREATE FOREIGN TABLE (SQL on other GaussDB(DWS))
- CREATE FUNCTION
- CREATE GROUP
- CREATE INDEX
- CREATE MATERIALIZED VIEW
- CREATE PROCEDURE
- CREATE PUBLICATION
- CREATE REDACTION POLICY
- CREATE ROW LEVEL SECURITY POLICY
- CREATE RESOURCE POOL
- CREATE ROLE
- CREATE SCHEMA
- CREATE SEQUENCE
- CREATE SERVER
- CREATE SUBSCRIPTION
- CREATE SYNONYM
- CREATE TABLE
- CREATE TABLE AS
- CREATE TABLE PARTITION
- CREATE TEXT SEARCH CONFIGURATION
- CREATE TEXT SEARCH DICTIONARY
- CREATE TRIGGER
- CREATE TYPE
- CREATE USER
- CREATE VIEW
- CURSOR
- DISCARD
- DROP BLOCK RULE
- DROP DATABASE
- DROP EXCEPT RULE
- DROP FOREIGN TABLE
- DROP FUNCTION
- DROP GROUP
- DROP INDEX
- DROP MATERIALIZED VIEW
- DROP OWNED
- DROP PUBLICATION
- DROP REDACTION POLICY
- DROP ROW LEVEL SECURITY POLICY
- DROP PROCEDURE
- DROP RESOURCE POOL
- DROP ROLE
- DROP SCHEMA
- DROP SEQUENCE
- DROP SERVER
- DROP SUBSCRIPTION
- DROP SYNONYM
- DROP TABLE
- DROP TEXT SEARCH CONFIGURATION
- DROP TEXT SEARCH DICTIONARY
- DROP TRIGGER
- DROP TYPE
- DROP USER
- DROP VIEW
- FETCH
- MOVE
- REFRESH MATERIALIZED VIEW
- REINDEX
- RENAME TABLE
- RESET
- SET
- SET CONSTRAINTS
- SET ROLE
- SET SESSION AUTHORIZATION
- SHOW
- TRUNCATE
- VACUUM
- DML语法
- DCL语法
- DQL语法
- TCL语法
-
SQL语法参考(8.1.3.x)
- GaussDB(DWS) SQL概述
- 与PostgreSQL的差异
- 关键字
- 数据类型
- 常量与宏
- 函数和操作符
- 表达式
- 类型转换
- 全文检索
- 系统操作
- 事务管理
-
DDL语法
- DDL语法一览表
- ALTER DATABASE
- ALTER FOREIGN TABLE (GDS导入导出)
- ALTER FOREIGN TABLE (For HDFS or OBS)
- ALTER FOREIGN TABLE (SQL on other GaussDB(DWS))
- ALTER FUNCTION
- ALTER GROUP
- ALTER INDEX
- ALTER LARGE OBJECT
- ALTER REDACTION POLICY
- ALTER RESOURCE POOL
- ALTER ROLE
- ALTER ROW LEVEL SECURITY POLICY
- ALTER SCHEMA
- ALTER SEQUENCE
- ALTER SERVER
- ALTER SESSION
- ALTER SYNONYM
- ALTER SYSTEM KILL SESSION
- ALTER TABLE
- ALTER TABLE PARTITION
- ALTER TEXT SEARCH CONFIGURATION
- ALTER TEXT SEARCH DICTIONARY
- ALTER TRIGGER
- ALTER TYPE
- ALTER USER
- ALTER VIEW
- CLEAN CONNECTION
- CLOSE
- CLUSTER
- COMMENT
- CREATE BARRIER
- CREATE DATABASE
- CREATE FOREIGN TABLE (GDS导入导出)
- CREATE FOREIGN TABLE (SQL on OBS or Hadoop)
- CREATE FOREIGN TABLE (OBS导入导出)
- CREATE FOREIGN TABLE (SQL on other GaussDB(DWS))
- CREATE FUNCTION
- CREATE GROUP
- CREATE INDEX
- CREATE REDACTION POLICY
- CREATE ROW LEVEL SECURITY POLICY
- CREATE PROCEDURE
- CREATE RESOURCE POOL
- CREATE ROLE
- CREATE SCHEMA
- CREATE SEQUENCE
- CREATE SERVER
- CREATE SYNONYM
- CREATE TABLE
- CREATE TABLE AS
- CREATE TABLE PARTITION
- CREATE TEXT SEARCH CONFIGURATION
- CREATE TEXT SEARCH DICTIONARY
- CREATE TRIGGER
- CREATE TYPE
- CREATE USER
- CREATE VIEW
- CURSOR
- DROP DATABASE
- DROP FOREIGN TABLE
- DROP FUNCTION
- DROP GROUP
- DROP INDEX
- DROP OWNED
- DROP REDACTION POLICY
- DROP ROW LEVEL SECURITY POLICY
- DROP PROCEDURE
- DROP RESOURCE POOL
- DROP ROLE
- DROP SCHEMA
- DROP SEQUENCE
- DROP SERVER
- DROP SYNONYM
- DROP TABLE
- DROP TEXT SEARCH CONFIGURATION
- DROP TEXT SEARCH DICTIONARY
- DROP TRIGGER
- DROP TYPE
- DROP USER
- DROP VIEW
- FETCH
- MOVE
- REINDEX
- RENAME TABLE
- RESET
- SET
- SET CONSTRAINTS
- SET ROLE
- SET SESSION AUTHORIZATION
- SHOW
- TRUNCATE
- VACUUM
- DML语法
- DCL语法
- DQL语法
- TCL语法
- 历史版本
-
SQL语法参考(9.1.0.x)
- 性能调优
-
工具指南
- 工具简介
- 工具下载
- gsql
- Data Studio
- GDS
-
DSC
- 前言
- DSC简介
- 使用DSC
- Teradata语法迁移
-
MySQL语法迁移
- 支持的关键词和特性
- 数据类型
- 函数和表达式
-
表(可选参数、操作)
- ALGORITHM
- ALTER TABLE RENAME
- AUTO_INCREMENT
- AVG_ROW_LENGTH
- BLOCK_SIZE
- CHARSET
- CHECKSUM
- CLUSTERED KEY
- COLLATE
- COMMENT
- CONNECTION
- DEFAULT
- DELAY_KEY_WRITE
- DISTRIBUTE BY
- DIRECTORY
- ENGINE
- FOREIGN_KEY_CHECKS
- IF NOT EXISTS
- INDEX_ALL
- INSERT_METHOD
- KEY_BLOCK_SIZE
- LOCK
- MAX_ROWS
- MIN_ROWS
- PACK_KEYS
- PARTITION BY
- PASSWORD
- ROW_FORMAT
- STATS_AUTO_RECALC
- STATS_PERSISTENT
- STATS_SAMPLE_PAGES
- UNION
- WITH AS
- CHANGE修改列
- CHECK约束
- DROP删除表
- LIKE 表克隆
- MODIFY修改列
- TRUNCATE 删除表
- ROUNDROBIN表
- RENAME 重命名表名
- 设置与清除列默认值
- 字段名重命名
- 行列存压缩
- 添加与删除列
- 索引
- 注释
- 数据库
- 数据操作语句(DML)
- 事务管理和数据库管理
- Oracle语法迁移
- Netezza语法迁移
- DSC常见问题
- 故障处理
- 术语表
- DWS-Connector
- 服务端工具
-
API参考
- 使用前必读
- API概述
- 如何调用API
- 快速入门
-
API说明
- 可用区
-
集群管理
- 创建集群
- V2创建集群
- 创建逻辑集群
- 物理集群转换到逻辑集群
- 查询集群列表
- 查询逻辑集群列表
- 查询逻辑集群任务信息
- 查询逻辑集群磁盘信息
- 查询节点列表
- 查询逻辑集群可用ring环节点信息
- 查询集群拓扑ring环节点信息
- 查询集群详情
- 查询节点类型
- 删除集群
- 删除逻辑集群
- 编辑逻辑集群
- 重启逻辑集群
- 切换逻辑集群开关
- 删除节点
- 从空闲节点扩容
- 恢复重分布
- 暂停重分布
- 重启集群
- 扩容集群
- 重置密码
- 创建集群前检查
- 集群缩容
- 下发重分布
- 查询重分布详情
- 查询专属分布式存储池列表
- 查询资源统计信息列表
- 主备恢复
- 解除只读
- 磁盘扩容
- 修改运维时间窗
- 查询集群CN节点
- 批量增加CN节点
- 批量删除CN节点
- 查询集群参数组
- 查询集群参数配置
- 修改集群参数配置
- 快照统计信息
- 查询合适的缩容数
- 查询参数修改审计记录
- 保存集群描述信息
- 查询单个实例
- 快照管理
- 事件管理
- 数据源
- 审计日志
- 资源管理
- 告警管理
- 连接管理
- 标签管理
- 配额管理
- 容灾管理
- 任务管理
- 主机监控
- 数据库权限管理
- 日志管理
- 升级管理
- 应用示例
- 权限及授权项说明
- 附录
- SDK参考
-
常见问题
- Top问题汇总
- 产品咨询
- 数据库连接
- 数据迁移
-
数据库使用
- 如何调整GaussDB(DWS)分布列?
- 如何查看和设置GaussDB(DWS)数据库的字符集编码格式
- 如何处理GaussDB(DWS)建表时date类型字段自动转换为timestamp类型的问题?
- GaussDB(DWS)是否需要定时对常用的表做VACUUM FULL和ANALYZE操作?
- 如何导出GaussDB(DWS)某张表结构?
- GaussDB(DWS)是否有高效的删除表数据的方法?
- 如何查看GaussDB(DWS)外部表信息?
- 如果GaussDB(DWS)建表时没有指定分布列,数据会怎么存储?
- 如何将GaussDB(DWS)联结查询的null结果替换成0?
- 如何查看GaussDB(DWS)表是行存还是列存?
- GaussDB(DWS)列存表的常用信息查询
- GaussDB(DWS)查询时索引失效场景解析
- 如何使用GaussDB(DWS)自定义函数改写CRC32()函数
- GaussDB(DWS)以pg_toast_temp*或pg_temp*开头的Schema是什么?
- GaussDB(DWS)查询时结果不一致的常见场景和解决方法
- GaussDB(DWS)哪些系统表不能做VACUUM FULL
- GaussDB(DWS)语句处于idle in transaction状态常见场景
- GaussDB(DWS)如何实现行转列及列转行?
- GaussDB(DWS)唯一约束和唯一索引有什么区别?
- GaussDB(DWS)函数和存储过程有什么区别?
- 如何删除GaussDB(DWS)重复的表数据?
-
集群管理
- 如何清理与回收GaussDB(DWS)存储空间?
- 为什么GaussDB(DWS)扩容后已使用存储容量比扩容前减少了很多?
- GaussDB(DWS)的磁盘空间/容量是如何统计的?
- GaussDB(DWS)添加云监控服务的告警规则时会话数阈值如何设置?
- 如何判断GaussDB(DWS)集群是x86还是ARM架构?
- GaussDB(DWS)扩容检查不通过怎么办?
- GaussDB(DWS)增加CN和扩容集群分别在什么场景下使用?
- GaussDB(DWS)经典变更规格与弹性变更规格、扩容、缩容分别在什么场景下使用?
- GaussDB(DWS)在CPU核数、内存相同的情况下,小规格多节点与大规格三节点集群如何选择?
- GaussDB(DWS) SSD云盘和SSD本地盘的区别?
- GaussDB(DWS)热数据存储和冷数据存储的区别?
- GaussDB(DWS)缩容按钮置灰如何处理?
- 账户与权限
- 数据库性能
- 备份恢复
-
故障排除
- 数据库连接管理
- JDBC/ODBC类
-
数据导入/导出
- 使用COPY FROM导入时报错“invalid byte sequence for encoding "UTF8": 0x00”
- GDS导入/导出类问题
- 创建GDS外表失败,提示不支持ROUNDROBIN
- 通过CDM将MySQL数据导入GaussDB(DWS)时出现字段超长,数据同步失败
- 执行创建OBS外表的SQL语句时,提示Access Denied
- GDS导入失败后,磁盘占用空间增大
- GDS导入数据时,脚本执行报错:out of memory
- 使用GDS传输数据的过程中,报错:connection failure error
- 使用DataArts Studio服务创建GaussDB(DWS)外表时不支持中文,如何处理
- 数据库参数修改
- 账号/权限/密码
-
集群性能
- 锁等待检测
- 执行SQL时出现表死锁,提示LOCK_WAIT_TIMEOUT锁等待超时
- 执行SQL时报错:abort transaction due to concurrent update
- 磁盘使用率高&集群只读处理方案
- SQL执行很慢,性能低,有时长时间运行未结束
- 数据倾斜导致SQL执行慢,大表SQL执行无结果
- VACUUM FULL一张表后,表文件大小无变化
- 删除表数据后执行了VACUUM,但存储空间并没有释放
- 执行VACUUM FULL命令时报错:Lock wait timeout
- VACUUM FULL执行慢
- 表数据膨胀导致SQL查询慢,用户前台页面数据加载不出
- 集群报错内存溢出
- 带自定义函数的语句不下推
- 列存表更新失败或多次更新后出现表膨胀
- 列存表多次插入后出现表膨胀
- 往GaussDB(DWS)写数据慢,客户端数据会有积压
- 分析查询效率异常降低的问题
- 未收集统计信息导致查询性能差
- 执行计划中有NestLoop导致SQL语句执行慢
- 未分区剪枝导致SQL查询慢
- 行数估算过小,优化器选择走NestLoop导致性能下降
- 语句中存在“in 常量”导致SQL执行无结果
- 单表点查询性能差
- 动态负载管理下的CCN排队
- 数据膨胀磁盘空间不足,导致性能降低
- 列存小CU多导致的性能慢问题
- 降低I/O的处理方案
- 高CPU系统性能调优方案
- 降低内存的处理方案
- 集群异常
-
数据库使用
- 插入或更新数据时报错,提示分布键不能被更新
- 执行SQL语句时提示“Connection reset by peer”
- VARCHAR(n)存储中文字符,提示value too long for type character varying?
- SQL语句中字段名大小写敏感问题
- 删除表时报错:cannot drop table test because other objects depend on it
- 多个表同时进行MERGE INTO UPDATE时,执行失败
- session_timeout设置导致JDBC业务报错
- DROP TABLE失败
- 使用string_agg函数查询执行结果不稳定
- 查询表大小时报错“could not open relation with OID xxx”
- DROP TABLE IF EXISTS语法误区
- 不同用户查询同表显示数据不同
- 修改索引只调用索引名提示索引不存在
- 执行CREATE SCHEMA语句时,报错SCHEMA已存在
- 删除数据库失败,提示有session正在连接
- 在Java中,读取character类型的表字段时返回类型为什么是byte?
- 执行表分区操作时,报错:start value of partition "xxx" NOT EQUAL up-boundary of last partition
- 重建索引失败
- 视图查询时执行失败
- 全局SQL查询
- 如何判断表是否执行过UPDATE或DELETE
- 执行业务报错“Can't fit xid into page”
- 执行业务报错:unable to get a stable set of rows in the source table
- DWS元数据不一致-分区索引异常
- 对系统表gs_wlm_session_info执行TRUNCATE命令报错
- 分区表插入数据报错:inserted partition key does not map to any table partition
- 范围分区表添加新分区报错upper boundary of adding partition MUST overtop last existing partition
- 查询表报错:missing chunk number %d for toast value %u in pg_toast_XXXX
- 向表中插入数据报错:duplicate key value violates unique constraint "%s"
- 执行业务报错could not determine which collation to use for string hashing
- 使用GaussDB(DWS) 的ODBC驱动,SQL查询结果中字符类型的字段内容会被截断
- 执行Plan Hint的Scan方式不生效
- 数据类型转换出现报错:invalid input syntax for xxx
- 业务报错:UNION types %s and %s cannot be matched
- 更新报错ERROR:Non-deterministic UPDATE
- 插入数据报错:null value in column '%s' violates not-null constraint
- 业务报错:unable to get a stable set of rows in the source table
- Oracle/TD/MySQL兼容模式下查询结果不一致
- 性能白皮书
- 技术白皮书
-
错误码参考
-
8.2.0及以下版本
- 管理控制台错误码
-
数据仓库错误码
- SQL标准错误码说明
- 第三方库错误码说明
- GAUSS-00001 -- GAUSS-00100
- GAUSS-00101 -- GAUSS-00200
- GAUSS-00201 -- GAUSS-00300
- GAUSS-00301 -- GAUSS-00400
- GAUSS-00401 -- GAUSS-00500
- GAUSS-00501 -- GAUSS-00600
- GAUSS-00601 -- GAUSS-00700
- GAUSS-00701 -- GAUSS-00800
- GAUSS-00801 -- GAUSS-00900
- GAUSS-00901 -- GAUSS-01000
- GAUSS-01001 -- GAUSS-01100
- GAUSS-01101 -- GAUSS-01200
- GAUSS-01201 -- GAUSS-01300
- GAUSS-01301 -- GAUSS-01400
- GAUSS-01401 -- GAUSS-01500
- GAUSS-01501 -- GAUSS-01600
- GAUSS-01601 -- GAUSS-01700
- GAUSS-01701 -- GAUSS-01800
- GAUSS-01801 -- GAUSS-01900
- GAUSS-01901 -- GAUSS-02000
- GAUSS-02001 -- GAUSS-02100
- GAUSS-02101 -- GAUSS-02200
- GAUSS-02201 -- GAUSS-02300
- GAUSS-02301 -- GAUSS-02400
- GAUSS-02401 -- GAUSS-02500
- GAUSS-02501 -- GAUSS-02600
- GAUSS-02601 -- GAUSS-02700
- GAUSS-02701 -- GAUSS-02800
- GAUSS-02801 -- GAUSS-02900
- GAUSS-02901 -- GAUSS-03000
- GAUSS-03001 -- GAUSS-03100
- GAUSS-03101 -- GAUSS-03200
- GAUSS-03201 -- GAUSS-03300
- GAUSS-03301 -- GAUSS-03400
- GAUSS-03401 -- GAUSS-03500
- GAUSS-03501 -- GAUSS-03600
- GAUSS-03601 -- GAUSS-03700
- GAUSS-03701 -- GAUSS-03800
- GAUSS-03801 -- GAUSS-03900
- GAUSS-03901 -- GAUSS-04000
- GAUSS-04001 -- GAUSS-04100
- GAUSS-04101 -- GAUSS-04200
- GAUSS-04201 -- GAUSS-04300
- GAUSS-04301 -- GAUSS-04400
- GAUSS-04401 -- GAUSS-04500
- GAUSS-04501 -- GAUSS-04600
- GAUSS-04601 -- GAUSS-04700
- GAUSS-04701 -- GAUSS-04800
- GAUSS-04901 -- GAUSS-04999
- GAUSS-05101 -- GAUSS-05200
- GAUSS-05201 -- GAUSS-05800
- GAUSS-05801 -- GAUSS-05900
- GAUSS-05901 -- GAUSS-05999
- GAUSS-06101 -- GAUSS-06200
- GAUSS-50000 -- GAUSS-50999
- GAUSS-51000 -- GAUSS-51999
- GAUSS-52000 -- GAUSS-52999
- GAUSS-53000 -- GAUSS-53999
- OE000
- 8.2.1及以上版本
-
8.2.0及以下版本
- 产品术语
-
更多文档
-
用户指南(阿布扎比区域)
- 产品介绍
- 入门
- GaussDB(DWS) 使用简介
- 准备工作
- 配置集群
- 连接集群
- 管理集群
- 集群高可用
- 监控与告警
- 集群安全管理
- 审计日志
-
常见问题
- 通用问题
- 集群管理
- 数据库连接
- 数据导入导出
- 帐户、密码、权限
-
数据库使用
- 如何调整分布列?
- 如何查看和设置数据库的字符集编码格式
- 如何处理建表时date类型字段自动转换为timestamp类型的问题?
- 是否需要定时对常用的表做VACUUM FULL和ANALYZE操作?
- GaussDB(DWS)数据库设置主键后还需要设置分布键吗?
- GaussDB(DWS)是否兼容PostgreSQL的存储过程?
- 如何理解分区表、数据分区和分区键?
- 如何导出某张表结构?
- 如何导出数据库中所有表和视图?
- 是否有高效的删除表数据的方法?
- 如何查看外部表信息?
- 如果建表时没有指定分布列,数据会怎么存储?
- 如何将联结查询的null结果替换成0?
- 如何查看表是行存还是列存?
- GaussDB(DWS)列存表的常用信息查询
- GaussDB(DWS)查询时索引失效场景解析
- 如何使用自定义函数改写CRC32()函数
- 以pg_toast_temp*或pg_temp*开头的Schema是什么?
- GaussDB(DWS)查询时结果不一致的常见场景和解决方法
- 哪些系统表不能做VACUUM FULL
- 语句处于idle in transaction状态常见场景
- 数据库性能
- 快照备份恢复
- 修订记录
- API参考(阿布扎比区域)
-
开发指南(阿布扎比区域)
- 欢迎
- 系统概述
- 数据迁移
- Oracle、Teradata和MySQL语法兼容性差异
- 管理数据库安全
- 开发设计建议
-
教程:使用JDBC或ODBC开发
- 开发规范
- 驱动下载
-
基于JDBC开发
- JDBC包与驱动类
- 开发流程
- 加载驱动
- 连接数据库
- 执行SQL语句
- 处理结果集
- 关闭连接
- 示例:常用操作
- 示例:重新执行应用SQL
- 示例:通过本地文件导入导出数据
- 示例:从MySQL向GaussDB(DWS)进行数据迁移
-
JDBC接口参考
- java.sql.Connection
- java.sql.CallableStatement
- java.sql.DatabaseMetaData
- java.sql.Driver
- java.sql.PreparedStatement
- java.sql.ResultSet
- java.sql.ResultSetMetaData
- java.sql.Statement
- javax.sql.ConnectionPoolDataSource
- javax.sql.DataSource
- javax.sql.PooledConnection
- javax.naming.Context
- javax.naming.spi.InitialContextFactory
- CopyManager
- 基于ODBC开发
- PostGIS Extension
- 资源负载管理
- 优化查询性能
- 用户自定义函数
- 存储过程
-
系统表和系统视图
- 系统表和系统视图概述
-
系统表
- GS_OBSSCANINFO
- GS_WLM_INSTANCE_HISTORY
- GS_WLM_OPERATOR_INFO
- GS_WLM_SESSION_INFO
- GS_WLM_USER_RESOURCE_HISTORY
- PG_AGGREGATE
- PG_AM
- PG_AMOP
- PG_AMPROC
- PG_ATTRDEF
- PG_ATTRIBUTE
- PG_AUTHID
- PG_AUTH_HISTORY
- PG_AUTH_MEMBERS
- PG_CAST
- PG_CLASS
- PG_COLLATION
- PG_CONSTRAINT
- PG_CONVERSION
- PG_DATABASE
- PG_DB_ROLE_SETTING
- PG_DEFAULT_ACL
- PG_DEPEND
- PG_DESCRIPTION
- PG_ENUM
- PG_EXTENSION
- PG_EXTENSION_DATA_SOURCE
- PG_FOREIGN_DATA_WRAPPER
- PG_FOREIGN_SERVER
- PG_FOREIGN_TABLE
- PG_INDEX
- PG_INHERITS
- PG_JOBS
- PG_LANGUAGE
- PG_LARGEOBJECT
- PG_LARGEOBJECT_METADATA
- PG_NAMESPACE
- PG_OBJECT
- PG_OBSSCANINFO
- PG_OPCLASS
- PG_OPERATOR
- PG_OPFAMILY
- PG_PARTITION
- PG_PLTEMPLATE
- PG_PROC
- PG_RANGE
- PG_REDACTION_COLUMN
- PG_REDACTION_POLICY
- PG_RLSPOLICY
- PG_RESOURCE_POOL
- PG_REWRITE
- PG_SECLABEL
- PG_SHDEPEND
- PG_SHDESCRIPTION
- PG_SHSECLABEL
- PG_STATISTIC
- PG_STATISTIC_EXT
- PG_SYNONYM
- PG_TABLESPACE
- PG_TRIGGER
- PG_TS_CONFIG
- PG_TS_CONFIG_MAP
- PG_TS_DICT
- PG_TS_PARSER
- PG_TS_TEMPLATE
- PG_TYPE
- PG_USER_MAPPING
- PG_USER_STATUS
- PG_WORKLOAD_ACTION
- PGXC_CLASS
- PGXC_GROUP
- PGXC_NODE
-
系统视图
- ALL_ALL_TABLES
- ALL_CONSTRAINTS
- ALL_CONS_COLUMNS
- ALL_COL_COMMENTS
- ALL_DEPENDENCIES
- ALL_IND_COLUMNS
- ALL_IND_EXPRESSIONS
- ALL_INDEXES
- ALL_OBJECTS
- ALL_PROCEDURES
- ALL_SEQUENCES
- ALL_SOURCE
- ALL_SYNONYMS
- ALL_TAB_COLUMNS
- ALL_TAB_COMMENTS
- ALL_TABLES
- ALL_USERS
- ALL_VIEWS
- DBA_DATA_FILES
- DBA_USERS
- DBA_COL_COMMENTS
- DBA_CONSTRAINTS
- DBA_CONS_COLUMNS
- DBA_IND_COLUMNS
- DBA_IND_EXPRESSIONS
- DBA_IND_PARTITIONS
- DBA_INDEXES
- DBA_OBJECTS
- DBA_PART_INDEXES
- DBA_PART_TABLES
- DBA_PROCEDURES
- DBA_SEQUENCES
- DBA_SOURCE
- DBA_SYNONYMS
- DBA_TAB_COLUMNS
- DBA_TAB_COMMENTS
- DBA_TAB_PARTITIONS
- DBA_TABLES
- DBA_TABLESPACES
- DBA_TRIGGERS
- DBA_VIEWS
- DUAL
- GLOBAL_REDO_STAT
- GLOBAL_REL_IOSTAT
- GLOBAL_STAT_DATABASE
- GLOBAL_WORKLOAD_SQL_COUNT
- GLOBAL_WORKLOAD_SQL_ELAPSE_TIME
- GLOBAL_WORKLOAD_TRANSACTION
- GS_ALL_CONTROL_GROUP_INFO
- GS_CLUSTER_RESOURCE_INFO
- GS_INSTR_UNIQUE_SQL
- GS_REL_IOSTAT
- GS_NODE_STAT_RESET_TIME
- GS_SESSION_CPU_STATISTICS
- GS_SESSION_MEMORY_STATISTICS
- GS_SQL_COUNT
- GS_WAIT_EVENTS
- GS_WLM_OPERAROR_INFO
- GS_WLM_OPERATOR_HISTORY
- GS_WLM_OPERATOR_STATISTICS
- GS_WLM_SESSION_INFO
- GS_WLM_SESSION_HISTORY
- GS_WLM_SESSION_STATISTICS
- GS_WLM_SQL_ALLOW
- GS_WORKLOAD_SQL_COUNT
- GS_WORKLOAD_SQL_ELAPSE_TIME
- GS_WORKLOAD_TRANSACTION
- GS_STAT_DB_CU
- GS_STAT_SESSION_CU
- GS_TOTAL_NODEGROUP_MEMORY_DETAIL
- GS_USER_TRANSACTION
- GS_VIEW_DEPENDENCY
- GS_VIEW_DEPENDENCY_PATH
- GS_VIEW_INVALID
- PG_AVAILABLE_EXTENSION_VERSIONS
- PG_AVAILABLE_EXTENSIONS
- PG_BULKLOAD_STATISTICS
- PG_COMM_CLIENT_INFO
- PG_COMM_DELAY
- PG_COMM_STATUS
- PG_COMM_RECV_STREAM
- PG_COMM_SEND_STREAM
- PG_CONTROL_GROUP_CONFIG
- PG_CURSORS
- PG_EXT_STATS
- PG_GET_INVALID_BACKENDS
- PG_GET_SENDERS_CATCHUP_TIME
- PG_GROUP
- PG_INDEXES
- PG_JOB
- PG_JOB_PROC
- PG_JOB_SINGLE
- PG_LIFECYCLE_DATA_DISTRIBUTE
- PG_LOCKS
- PG_NODE_ENV
- PG_OS_THREADS
- PG_POOLER_STATUS
- PG_PREPARED_STATEMENTS
- PG_PREPARED_XACTS
- PG_QUERYBAND_ACTION
- PG_REPLICATION_SLOTS
- PG_ROLES
- PG_RULES
- PG_RUNNING_XACTS
- PG_SECLABELS
- PG_SESSION_WLMSTAT
- PG_SESSION_IOSTAT
- PG_SETTINGS
- PG_SHADOW
- PG_SHARED_MEMORY_DETAIL
- PG_STATS
- PG_STAT_ACTIVITY
- PG_STAT_ALL_INDEXES
- PG_STAT_ALL_TABLES
- PG_STAT_BAD_BLOCK
- PG_STAT_BGWRITER
- PG_STAT_DATABASE
- PG_STAT_DATABASE_CONFLICTS
- PG_STAT_GET_MEM_MBYTES_RESERVED
- PG_STAT_USER_FUNCTIONS
- PG_STAT_USER_INDEXES
- PG_STAT_USER_TABLES
- PG_STAT_REPLICATION
- PG_STAT_SYS_INDEXES
- PG_STAT_SYS_TABLES
- PG_STAT_XACT_ALL_TABLES
- PG_STAT_XACT_SYS_TABLES
- PG_STAT_XACT_USER_FUNCTIONS
- PG_STAT_XACT_USER_TABLES
- PG_STATIO_ALL_INDEXES
- PG_STATIO_ALL_SEQUENCES
- PG_STATIO_ALL_TABLES
- PG_STATIO_SYS_INDEXES
- PG_STATIO_SYS_SEQUENCES
- PG_STATIO_SYS_TABLES
- PG_STATIO_USER_INDEXES
- PG_STATIO_USER_SEQUENCES
- PG_STATIO_USER_TABLES
- PG_THREAD_WAIT_STATUS
- PG_TABLES
- PG_TIMEZONE_ABBREVS
- PG_TIMEZONE_NAMES
- PG_TOTAL_MEMORY_DETAIL
- PG_TOTAL_SCHEMA_INFO
- PG_TOTAL_USER_RESOURCE_INFO
- PG_USER
- PG_USER_MAPPINGS
- PG_VIEWS
- PG_WLM_STATISTICS
- PGXC_BULKLOAD_PROGRESS
- PGXC_BULKLOAD_STATISTICS
- PGXC_COMM_CLIENT_INFO
- PGXC_COMM_DELAY
- PGXC_COMM_RECV_STREAM
- PGXC_COMM_SEND_STREAM
- PGXC_COMM_STATUS
- PGXC_DEADLOCK
- PGXC_GET_STAT_ALL_TABLES
- PGXC_GET_STAT_ALL_PARTITIONS
- PGXC_GET_TABLE_SKEWNESS
- PGXC_GTM_SNAPSHOT_STATUS
- PGXC_INSTANCE_TIME
- PGXC_INSTR_UNIQUE_SQL
- PGXC_LOCK_CONFLICTS
- PGXC_NODE_ENV
- PGXC_NODE_STAT_RESET_TIME
- PGXC_OS_RUN_INFO
- PGXC_OS_THREADS
- PGXC_PREPARED_XACTS
- PGXC_REDO_STAT
- PGXC_REL_IOSTAT
- PGXC_REPLICATION_SLOTS
- PGXC_RUNNING_XACTS
- PGXC_SETTINGS
- PGXC_STAT_ACTIVITY
- PGXC_STAT_BAD_BLOCK
- PGXC_STAT_BGWRITER
- PGXC_STAT_DATABASE
- PGXC_STAT_REPLICATION
- PGXC_SQL_COUNT
- PGXC_THREAD_WAIT_STATUS
- PGXC_TOTAL_MEMORY_DETAIL
- PGXC_TOTAL_SCHEMA_INFO
- PGXC_TOTAL_SCHEMA_INFO_ANALYZE
- PGXC_USER_TRANSACTION
- PGXC_VARIABLE_INFO
- PGXC_WAIT_EVENTS
- PGXC_WLM_OPERATOR_HISTORY
- PGXC_WLM_OPERATOR_INFO
- PGXC_WLM_OPERATOR_STATISTICS
- PGXC_WLM_SESSION_INFO
- PGXC_WLM_SESSION_HISTORY
- PGXC_WLM_SESSION_STATISTICS
- PGXC_WLM_WORKLOAD_RECORDS
- PGXC_WORKLOAD_SQL_COUNT
- PGXC_WORKLOAD_SQL_ELAPSE_TIME
- PGXC_WORKLOAD_TRANSACTION
- PLAN_TABLE
- PLAN_TABLE_DATA
- PV_FILE_STAT
- PV_INSTANCE_TIME
- PV_OS_RUN_INFO
- PV_SESSION_MEMORY
- PV_SESSION_MEMORY_DETAIL
- PV_SESSION_STAT
- PV_SESSION_TIME
- PV_TOTAL_MEMORY_DETAIL
- PV_REDO_STAT
- REDACTION_COLUMNS
- REDACTION_POLICIES
- USER_COL_COMMENTS
- USER_CONSTRAINTS
- USER_CONS_COLUMNS
- USER_INDEXES
- USER_IND_COLUMNS
- USER_IND_EXPRESSIONS
- USER_IND_PARTITIONS
- USER_JOBS
- USER_OBJECTS
- USER_PART_INDEXES
- USER_PART_TABLES
- USER_PROCEDURES
- USER_SEQUENCES
- USER_SOURCE
- USER_SYNONYMS
- USER_TAB_COLUMNS
- USER_TAB_COMMENTS
- USER_TAB_PARTITIONS
- USER_TABLES
- USER_TRIGGERS
- USER_VIEWS
- V$SESSION
- V$SESSION_LONGOPS
- GUC参数
- 术语表
-
语法参考(阿布扎比区域)
- GaussDB(DWS) SQL
- GaussDB(DWS)与PostgreSQL的差异
- 关键字
- 数据类型
- 常量与宏
- 函数和操作符
- 表达式
- 类型转换
- 全文检索
- 系统操作
- 事务控制
-
DDL语法
- DDL语法一览表
- ALTER DATABASE
- ALTER FOREIGN TABLE (For GDS)
- ALTER FOREIGN TABLE (For HDFS or OBS)
- ALTER FUNCTION
- ALTER GROUP
- ALTER INDEX
- ALTER LARGE OBJECT
- ALTER REDACTION POLICY
- ALTER RESOURCE POOL
- ALTER ROLE
- ALTER ROW LEVEL SECURITY POLICY
- ALTER SCHEMA
- ALTER SEQUENCE
- ALTER SERVER
- ALTER SESSION
- ALTER SYNONYM
- ALTER SYSTEM KILL SESSION
- ALTER TABLE
- ALTER TABLE PARTITION
- ALTER TEXT SEARCH CONFIGURATION
- ALTER TEXT SEARCH DICTIONARY
- ALTER TRIGGER
- ALTER TYPE
- ALTER USER
- ALTER VIEW
- CLEAN CONNECTION
- CLOSE
- CLUSTER
- COMMENT
- CREATE BARRIER
- CREATE DATABASE
- CREATE FOREIGN TABLE (GDS导入导出)
- CREATE FOREIGN TABLE (SQL on OBS or Hadoop)
- CREATE FOREIGN TABLE (OBS导入导出)
- CREATE FUNCTION
- CREATE GROUP
- CREATE INDEX
- CREATE REDACTION POLICY
- CREATE ROW LEVEL SECURITY POLICY
- CREATE PROCEDURE
- CREATE RESOURCE POOL
- CREATE ROLE
- CREATE SCHEMA
- CREATE SEQUENCE
- CREATE SERVER
- CREATE SYNONYM
- CREATE TABLE
- CREATE TABLE AS
- CREATE TABLE PARTITION
- CREATE TEXT SEARCH CONFIGURATION
- CREATE TEXT SEARCH DICTIONARY
- CREATE TRIGGER
- CREATE TYPE
- CREATE USER
- CREATE VIEW
- CURSOR
- DROP DATABASE
- DROP FOREIGN TABLE
- DROP FUNCTION
- DROP GROUP
- DROP INDEX
- DROP OWNED
- DROP REDACTION POLICY
- DROP ROW LEVEL SECURITY POLICY
- DROP PROCEDURE
- DROP RESOURCE POOL
- DROP ROLE
- DROP SCHEMA
- DROP SEQUENCE
- DROP SERVER
- DROP SYNONYM
- DROP TABLE
- DROP TEXT SEARCH CONFIGURATION
- DROP TEXT SEARCH DICTIONARY
- DROP TRIGGER
- DROP TYPE
- DROP USER
- DROP VIEW
- FETCH
- MOVE
- REINDEX
- RESET
- SET
- SET CONSTRAINTS
- SET ROLE
- SET SESSION AUTHORIZATION
- SHOW
- TRUNCATE
- VACUUM
- DML语法
- DCL语法
- DQL语法
- TCL语法
- GIN索引
-
工具指南(阿布扎比区域)
- 工具简介
- 客户端工具下载
- gsql命令行客户端工具
- Data Studio数据库集成开发工具
- GDS并行数据加载工具
- DSC SQL语法迁移工具
- 服务端工具
- 错误码参考(阿布扎比区域)
-
用户指南(巴黎区域)
- 产品介绍
- 入门
- GaussDB(DWS) 使用简介
- 准备工作
- 创建与删除集群
- 连接集群
- 监控与告警
- 变配与扩容
- 备份与容灾
- 智能运维
- 集群管理
- 集群日志管理
- 数据库用户管理
- 审计日志
- 集群安全管理
- 资源管理
- 管理数据源
- 逻辑集群管理
-
常见问题
- 通用问题
-
数据库使用
- 如何调整分布列?
- 如何查看和设置数据库的字符集编码格式
- 如何处理建表时date类型字段自动转换为timestamp类型的问题?
- 是否需要定时对常用的表做VACUUM FULL和ANALYZE操作?
- GaussDB(DWS)数据库设置主键后还需要设置分布键吗?
- GaussDB(DWS)是否兼容PostgreSQL的存储过程?
- 如何理解分区表、数据分区和分区键?
- 如何导出某张表结构?
- 是否有高效的删除表数据的方法?
- 如何查看外部表信息?
- 如果建表时没有指定分布列,数据会怎么存储?
- 如何将联结查询的null结果替换成0?
- 如何查看表是行存还是列存?
- GaussDB(DWS)列存表的常用信息查询
- GaussDB(DWS)查询时索引失效场景解析
- 如何使用自定义函数改写CRC32()函数
- 以pg_toast_temp*或pg_temp*开头的Schema是什么?
- GaussDB(DWS)查询时结果不一致的常见场景和解决方法
- 哪些系统表不能做VACUUM FULL
- 语句处于idle in transaction状态常见场景
- GaussDB(DWS)如何实现行转列及列转行?
- 唯一约束和唯一索引有什么区别?
- 函数和存储过程有什么区别?
- 如何删除重复的表数据?
- 集群管理
- 数据库连接
- 数据导入导出
- 账户、密码、权限
- 数据库性能
- 快照备份恢复
- API参考 (巴黎区域)
-
开发指南(巴黎区域)
- 欢迎
- 系统概述
- 数据迁移
- Oracle、Teradata和MySQL语法兼容性差异
- 管理数据库安全
- 开发设计建议
-
教程:使用JDBC或ODBC开发
- 开发规范
- 驱动下载
-
基于JDBC开发
- JDBC包与驱动类
- 开发流程
- 加载驱动
- 连接数据库
- 执行SQL语句
- 处理结果集
- 关闭连接
- 示例:常用操作
- 示例:重新执行应用SQL
- 示例:通过本地文件导入导出数据
- 示例:从MySQL向GaussDB(DWS)进行数据迁移
-
JDBC接口参考
- java.sql.Connection
- java.sql.CallableStatement
- java.sql.DatabaseMetaData
- java.sql.Driver
- java.sql.PreparedStatement
- java.sql.ResultSet
- java.sql.ResultSetMetaData
- java.sql.Statement
- javax.sql.ConnectionPoolDataSource
- javax.sql.DataSource
- javax.sql.PooledConnection
- javax.naming.Context
- javax.naming.spi.InitialContextFactory
- CopyManager
- 基于ODBC开发
- PostGIS Extension
- 资源负载管理
- 资源监控
- 优化查询性能
- 用户自定义函数
- 存储过程
-
系统表和系统视图
- 系统表和系统视图概述
-
系统表
- GS_OBSSCANINFO
- GS_WLM_INSTANCE_HISTORY
- GS_WLM_OPERATOR_INFO
- GS_WLM_SESSION_INFO
- GS_WLM_USER_RESOURCE_HISTORY
- PG_AGGREGATE
- PG_AM
- PG_AMOP
- PG_AMPROC
- PG_ATTRDEF
- PG_ATTRIBUTE
- PG_AUTHID
- PG_AUTH_HISTORY
- PG_AUTH_MEMBERS
- PG_CAST
- PG_CLASS
- PG_COLLATION
- PG_CONSTRAINT
- PG_CONVERSION
- PG_DATABASE
- PG_DB_ROLE_SETTING
- PG_DEFAULT_ACL
- PG_DEPEND
- PG_DESCRIPTION
- PG_ENUM
- PG_EXTENSION
- PG_EXTENSION_DATA_SOURCE
- PG_FOREIGN_DATA_WRAPPER
- PG_FOREIGN_SERVER
- PG_FOREIGN_TABLE
- PG_INDEX
- PG_INHERITS
- PG_JOBS
- PG_LANGUAGE
- PG_LARGEOBJECT
- PG_LARGEOBJECT_METADATA
- PG_NAMESPACE
- PG_OBJECT
- PG_OBSSCANINFO
- PG_OPCLASS
- PG_OPERATOR
- PG_OPFAMILY
- PG_PARTITION
- PG_PLTEMPLATE
- PG_PROC
- PG_RANGE
- PG_REDACTION_COLUMN
- PG_REDACTION_POLICY
- PG_RLSPOLICY
- PG_RESOURCE_POOL
- PG_REWRITE
- PG_SECLABEL
- PG_SHDEPEND
- PG_SHDESCRIPTION
- PG_SHSECLABEL
- PG_STATISTIC
- PG_STATISTIC_EXT
- PG_SYNONYM
- PG_TABLESPACE
- PG_TRIGGER
- PG_TS_CONFIG
- PG_TS_CONFIG_MAP
- PG_TS_DICT
- PG_TS_PARSER
- PG_TS_TEMPLATE
- PG_TYPE
- PG_USER_MAPPING
- PG_USER_STATUS
- PG_WORKLOAD_ACTION
- PGXC_CLASS
- PGXC_GROUP
- PGXC_NODE
-
系统视图
- ALL_ALL_TABLES
- ALL_CONSTRAINTS
- ALL_CONS_COLUMNS
- ALL_COL_COMMENTS
- ALL_DEPENDENCIES
- ALL_IND_COLUMNS
- ALL_IND_EXPRESSIONS
- ALL_INDEXES
- ALL_OBJECTS
- ALL_PROCEDURES
- ALL_SEQUENCES
- ALL_SOURCE
- ALL_SYNONYMS
- ALL_TAB_COLUMNS
- ALL_TAB_COMMENTS
- ALL_TABLES
- ALL_USERS
- ALL_VIEWS
- DBA_DATA_FILES
- DBA_USERS
- DBA_COL_COMMENTS
- DBA_CONSTRAINTS
- DBA_CONS_COLUMNS
- DBA_IND_COLUMNS
- DBA_IND_EXPRESSIONS
- DBA_IND_PARTITIONS
- DBA_INDEXES
- DBA_OBJECTS
- DBA_PART_INDEXES
- DBA_PART_TABLES
- DBA_PROCEDURES
- DBA_SEQUENCES
- DBA_SOURCE
- DBA_SYNONYMS
- DBA_TAB_COLUMNS
- DBA_TAB_COMMENTS
- DBA_TAB_PARTITIONS
- DBA_TABLES
- DBA_TABLESPACES
- DBA_TRIGGERS
- DBA_VIEWS
- DUAL
- GLOBAL_REDO_STAT
- GLOBAL_REL_IOSTAT
- GLOBAL_STAT_DATABASE
- GLOBAL_WORKLOAD_SQL_COUNT
- GLOBAL_WORKLOAD_SQL_ELAPSE_TIME
- GLOBAL_WORKLOAD_TRANSACTION
- GS_ALL_CONTROL_GROUP_INFO
- GS_CLUSTER_RESOURCE_INFO
- GS_INSTR_UNIQUE_SQL
- GS_REL_IOSTAT
- GS_NODE_STAT_RESET_TIME
- GS_SESSION_CPU_STATISTICS
- GS_SESSION_MEMORY_STATISTICS
- GS_SQL_COUNT
- GS_WAIT_EVENTS
- GS_WLM_OPERAROR_INFO
- GS_WLM_OPERATOR_HISTORY
- GS_WLM_OPERATOR_STATISTICS
- GS_WLM_SESSION_INFO
- GS_WLM_SESSION_HISTORY
- GS_WLM_SESSION_STATISTICS
- GS_WLM_SQL_ALLOW
- GS_WORKLOAD_SQL_COUNT
- GS_WORKLOAD_SQL_ELAPSE_TIME
- GS_WORKLOAD_TRANSACTION
- GS_STAT_DB_CU
- GS_STAT_SESSION_CU
- GS_TOTAL_NODEGROUP_MEMORY_DETAIL
- GS_USER_TRANSACTION
- GS_VIEW_DEPENDENCY
- GS_VIEW_DEPENDENCY_PATH
- GS_VIEW_INVALID
- PG_AVAILABLE_EXTENSION_VERSIONS
- PG_AVAILABLE_EXTENSIONS
- PG_BULKLOAD_STATISTICS
- PG_COMM_CLIENT_INFO
- PG_COMM_DELAY
- PG_COMM_STATUS
- PG_COMM_RECV_STREAM
- PG_COMM_SEND_STREAM
- PG_CONTROL_GROUP_CONFIG
- PG_CURSORS
- PG_EXT_STATS
- PG_GET_INVALID_BACKENDS
- PG_GET_SENDERS_CATCHUP_TIME
- PG_GROUP
- PG_INDEXES
- PG_JOB
- PG_JOB_PROC
- PG_JOB_SINGLE
- PG_LIFECYCLE_DATA_DISTRIBUTE
- PG_LOCKS
- PG_NODE_ENV
- PG_OS_THREADS
- PG_POOLER_STATUS
- PG_PREPARED_STATEMENTS
- PG_PREPARED_XACTS
- PG_QUERYBAND_ACTION
- PG_REPLICATION_SLOTS
- PG_ROLES
- PG_RULES
- PG_RUNNING_XACTS
- PG_SECLABELS
- PG_SESSION_WLMSTAT
- PG_SESSION_IOSTAT
- PG_SETTINGS
- PG_SHADOW
- PG_SHARED_MEMORY_DETAIL
- PG_STATS
- PG_STAT_ACTIVITY
- PG_STAT_ALL_INDEXES
- PG_STAT_ALL_TABLES
- PG_STAT_BAD_BLOCK
- PG_STAT_BGWRITER
- PG_STAT_DATABASE
- PG_STAT_DATABASE_CONFLICTS
- PG_STAT_GET_MEM_MBYTES_RESERVED
- PG_STAT_USER_FUNCTIONS
- PG_STAT_USER_INDEXES
- PG_STAT_USER_TABLES
- PG_STAT_REPLICATION
- PG_STAT_SYS_INDEXES
- PG_STAT_SYS_TABLES
- PG_STAT_XACT_ALL_TABLES
- PG_STAT_XACT_SYS_TABLES
- PG_STAT_XACT_USER_FUNCTIONS
- PG_STAT_XACT_USER_TABLES
- PG_STATIO_ALL_INDEXES
- PG_STATIO_ALL_SEQUENCES
- PG_STATIO_ALL_TABLES
- PG_STATIO_SYS_INDEXES
- PG_STATIO_SYS_SEQUENCES
- PG_STATIO_SYS_TABLES
- PG_STATIO_USER_INDEXES
- PG_STATIO_USER_SEQUENCES
- PG_STATIO_USER_TABLES
- PG_THREAD_WAIT_STATUS
- PG_TABLES
- PG_TIMEZONE_ABBREVS
- PG_TIMEZONE_NAMES
- PG_TOTAL_MEMORY_DETAIL
- PG_TOTAL_SCHEMA_INFO
- PG_TOTAL_USER_RESOURCE_INFO
- PG_USER
- PG_USER_MAPPINGS
- PG_VIEWS
- PG_WLM_STATISTICS
- PGXC_BULKLOAD_PROGRESS
- PGXC_BULKLOAD_STATISTICS
- PGXC_COMM_CLIENT_INFO
- PGXC_COMM_DELAY
- PGXC_COMM_RECV_STREAM
- PGXC_COMM_SEND_STREAM
- PGXC_COMM_STATUS
- PGXC_DEADLOCK
- PGXC_GET_STAT_ALL_TABLES
- PGXC_GET_STAT_ALL_PARTITIONS
- PGXC_GET_TABLE_SKEWNESS
- PGXC_GTM_SNAPSHOT_STATUS
- PGXC_INSTANCE_TIME
- PGXC_INSTR_UNIQUE_SQL
- PGXC_LOCK_CONFLICTS
- PGXC_NODE_ENV
- PGXC_NODE_STAT_RESET_TIME
- PGXC_OS_RUN_INFO
- PGXC_OS_THREADS
- PGXC_PREPARED_XACTS
- PGXC_REDO_STAT
- PGXC_REL_IOSTAT
- PGXC_REPLICATION_SLOTS
- PGXC_RUNNING_XACTS
- PGXC_SETTINGS
- PGXC_STAT_ACTIVITY
- PGXC_STAT_BAD_BLOCK
- PGXC_STAT_BGWRITER
- PGXC_STAT_DATABASE
- PGXC_STAT_REPLICATION
- PGXC_SQL_COUNT
- PGXC_THREAD_WAIT_STATUS
- PGXC_TOTAL_MEMORY_DETAIL
- PGXC_TOTAL_SCHEMA_INFO
- PGXC_TOTAL_SCHEMA_INFO_ANALYZE
- PGXC_USER_TRANSACTION
- PGXC_VARIABLE_INFO
- PGXC_WAIT_EVENTS
- PGXC_WLM_OPERATOR_HISTORY
- PGXC_WLM_OPERATOR_INFO
- PGXC_WLM_OPERATOR_STATISTICS
- PGXC_WLM_SESSION_INFO
- PGXC_WLM_SESSION_HISTORY
- PGXC_WLM_SESSION_STATISTICS
- PGXC_WLM_WORKLOAD_RECORDS
- PGXC_WORKLOAD_SQL_COUNT
- PGXC_WORKLOAD_SQL_ELAPSE_TIME
- PGXC_WORKLOAD_TRANSACTION
- PLAN_TABLE
- PLAN_TABLE_DATA
- PV_FILE_STAT
- PV_INSTANCE_TIME
- PV_OS_RUN_INFO
- PV_SESSION_MEMORY
- PV_SESSION_MEMORY_DETAIL
- PV_SESSION_STAT
- PV_SESSION_TIME
- PV_TOTAL_MEMORY_DETAIL
- PV_REDO_STAT
- REDACTION_COLUMNS
- REDACTION_POLICIES
- USER_COL_COMMENTS
- USER_CONSTRAINTS
- USER_CONS_COLUMNS
- USER_INDEXES
- USER_IND_COLUMNS
- USER_IND_EXPRESSIONS
- USER_IND_PARTITIONS
- USER_JOBS
- USER_OBJECTS
- USER_PART_INDEXES
- USER_PART_TABLES
- USER_PROCEDURES
- USER_SEQUENCES
- USER_SOURCE
- USER_SYNONYMS
- USER_TAB_COLUMNS
- USER_TAB_COMMENTS
- USER_TAB_PARTITIONS
- USER_TABLES
- USER_TRIGGERS
- USER_VIEWS
- V$SESSION
- V$SESSION_LONGOPS
- GUC参数
- 术语表
-
语法参考(巴黎区域)
- GaussDB(DWS) SQL
- GaussDB(DWS)与PostgreSQL的差异
- 关键字
- 数据类型
- 常量与宏
- 函数和操作符
- 表达式
- 类型转换
- 全文检索
- 系统操作
- 事务控制
-
DDL语法
- DDL语法一览表
- ALTER DATABASE
- ALTER FOREIGN TABLE (For GDS)
- ALTER FOREIGN TABLE (For HDFS or OBS)
- ALTER FUNCTION
- ALTER GROUP
- ALTER INDEX
- ALTER LARGE OBJECT
- ALTER REDACTION POLICY
- ALTER RESOURCE POOL
- ALTER ROLE
- ALTER ROW LEVEL SECURITY POLICY
- ALTER SCHEMA
- ALTER SEQUENCE
- ALTER SERVER
- ALTER SESSION
- ALTER SYNONYM
- ALTER SYSTEM KILL SESSION
- ALTER TABLE
- ALTER TABLE PARTITION
- ALTER TEXT SEARCH CONFIGURATION
- ALTER TEXT SEARCH DICTIONARY
- ALTER TRIGGER
- ALTER TYPE
- ALTER USER
- ALTER VIEW
- CLEAN CONNECTION
- CLOSE
- CLUSTER
- COMMENT
- CREATE BARRIER
- CREATE DATABASE
- CREATE FOREIGN TABLE (GDS导入导出)
- CREATE FOREIGN TABLE (SQL on OBS or Hadoop )
- CREATE FOREIGN TABLE (OBS导入导出)
- CREATE FUNCTION
- CREATE GROUP
- CREATE INDEX
- CREATE REDACTION POLICY
- CREATE ROW LEVEL SECURITY POLICY
- CREATE PROCEDURE
- CREATE RESOURCE POOL
- CREATE ROLE
- CREATE SCHEMA
- CREATE SEQUENCE
- CREATE SERVER
- CREATE SYNONYM
- CREATE TABLE
- CREATE TABLE AS
- CREATE TABLE PARTITION
- CREATE TABLESPACE
- CREATE TEXT SEARCH CONFIGURATION
- CREATE TEXT SEARCH DICTIONARY
- CREATE TRIGGER
- CREATE TYPE
- CREATE USER
- CREATE VIEW
- CURSOR
- DROP DATABASE
- DROP FOREIGN TABLE
- DROP FUNCTION
- DROP GROUP
- DROP INDEX
- DROP OWNED
- DROP REDACTION POLICY
- DROP ROW LEVEL SECURITY POLICY
- DROP PROCEDURE
- DROP RESOURCE POOL
- DROP ROLE
- DROP SCHEMA
- DROP SEQUENCE
- DROP SERVER
- DROP SYNONYM
- DROP TABLE
- DROP TABLESPACE
- DROP TEXT SEARCH CONFIGURATION
- DROP TEXT SEARCH DICTIONARY
- DROP TRIGGER
- DROP TYPE
- DROP USER
- DROP VIEW
- FETCH
- MOVE
- REINDEX
- RESET
- SET
- SET CONSTRAINTS
- SET ROLE
- SET SESSION AUTHORIZATION
- SHOW
- TRUNCATE
- VACUUM
- DML语法
- DCL语法
- DQL语法
- TCL语法
- GIN索引
-
工具指南(巴黎区域)
- 工具简介
- 客户端工具下载
- gsql命令行客户端工具
- Data Studio数据库集成开发工具
- GDS并行数据加载工具
- DSC SQL语法迁移工具
- 服务端工具
- 错误码参考(巴黎区域)
- 用户指南(吉隆坡区域)
- API参考(吉隆坡区域)
-
开发指南(吉隆坡地区)
- 欢迎
- 系统概述
- 数据迁移
- Oracle、Teradata和MySQL语法兼容性差异
- 管理数据库安全
- 开发设计建议
-
教程:使用JDBC或ODBC开发
- 开发规范
- 驱动下载
-
基于JDBC开发
- JDBC包与驱动类
- 开发流程
- 加载驱动
- 连接数据库
- 执行SQL语句
- 处理结果集
- 关闭连接
- 示例:常用操作
- 示例:重新执行应用SQL
- 示例:通过本地文件导入导出数据
- 示例:从MySQL向GaussDB(DWS)进行数据迁移
-
JDBC接口参考
- java.sql.Connection
- java.sql.CallableStatement
- java.sql.DatabaseMetaData
- java.sql.Driver
- java.sql.PreparedStatement
- java.sql.ResultSet
- java.sql.ResultSetMetaData
- java.sql.Statement
- javax.sql.ConnectionPoolDataSource
- javax.sql.DataSource
- javax.sql.PooledConnection
- javax.naming.Context
- javax.naming.spi.InitialContextFactory
- CopyManager
- 基于ODBC开发
- PostGIS Extension
- 资源负载管理
- 资源监控
- 优化查询性能
- 用户自定义函数
- 存储过程
-
系统表和系统视图
- 系统表和系统视图概述
-
系统表
- GS_OBSSCANINFO
- GS_WLM_INSTANCE_HISTORY
- GS_WLM_OPERATOR_INFO
- GS_WLM_SESSION_INFO
- GS_WLM_USER_RESOURCE_HISTORY
- PG_AGGREGATE
- PG_AM
- PG_AMOP
- PG_AMPROC
- PG_ATTRDEF
- PG_ATTRIBUTE
- PG_AUTHID
- PG_AUTH_HISTORY
- PG_AUTH_MEMBERS
- PG_CAST
- PG_CLASS
- PG_COLLATION
- PG_CONSTRAINT
- PG_CONVERSION
- PG_DATABASE
- PG_DB_ROLE_SETTING
- PG_DEFAULT_ACL
- PG_DEPEND
- PG_DESCRIPTION
- PG_ENUM
- PG_EXTENSION
- PG_EXTENSION_DATA_SOURCE
- PG_FOREIGN_DATA_WRAPPER
- PG_FOREIGN_SERVER
- PG_FOREIGN_TABLE
- PG_INDEX
- PG_INHERITS
- PG_JOBS
- PG_LANGUAGE
- PG_LARGEOBJECT
- PG_LARGEOBJECT_METADATA
- PG_NAMESPACE
- PG_OBJECT
- PG_OBSSCANINFO
- PG_OPCLASS
- PG_OPERATOR
- PG_OPFAMILY
- PG_PARTITION
- PG_PLTEMPLATE
- PG_PROC
- PG_RANGE
- PG_REDACTION_COLUMN
- PG_REDACTION_POLICY
- PG_RLSPOLICY
- PG_RESOURCE_POOL
- PG_REWRITE
- PG_SECLABEL
- PG_SHDEPEND
- PG_SHDESCRIPTION
- PG_SHSECLABEL
- PG_STATISTIC
- PG_STATISTIC_EXT
- PG_SYNONYM
- PG_TABLESPACE
- PG_TRIGGER
- PG_TS_CONFIG
- PG_TS_CONFIG_MAP
- PG_TS_DICT
- PG_TS_PARSER
- PG_TS_TEMPLATE
- PG_TYPE
- PG_USER_MAPPING
- PG_USER_STATUS
- PG_WORKLOAD_ACTION
- PGXC_CLASS
- PGXC_GROUP
- PGXC_NODE
-
系统视图
- ALL_ALL_TABLES
- ALL_CONSTRAINTS
- ALL_CONS_COLUMNS
- ALL_COL_COMMENTS
- ALL_DEPENDENCIES
- ALL_IND_COLUMNS
- ALL_IND_EXPRESSIONS
- ALL_INDEXES
- ALL_OBJECTS
- ALL_PROCEDURES
- ALL_SEQUENCES
- ALL_SOURCE
- ALL_SYNONYMS
- ALL_TAB_COLUMNS
- ALL_TAB_COMMENTS
- ALL_TABLES
- ALL_USERS
- ALL_VIEWS
- DBA_DATA_FILES
- DBA_USERS
- DBA_COL_COMMENTS
- DBA_CONSTRAINTS
- DBA_CONS_COLUMNS
- DBA_IND_COLUMNS
- DBA_IND_EXPRESSIONS
- DBA_IND_PARTITIONS
- DBA_INDEXES
- DBA_OBJECTS
- DBA_PART_INDEXES
- DBA_PART_TABLES
- DBA_PROCEDURES
- DBA_SEQUENCES
- DBA_SOURCE
- DBA_SYNONYMS
- DBA_TAB_COLUMNS
- DBA_TAB_COMMENTS
- DBA_TAB_PARTITIONS
- DBA_TABLES
- DBA_TABLESPACES
- DBA_TRIGGERS
- DBA_VIEWS
- DUAL
- GLOBAL_REDO_STAT
- GLOBAL_REL_IOSTAT
- GLOBAL_STAT_DATABASE
- GLOBAL_WORKLOAD_SQL_COUNT
- GLOBAL_WORKLOAD_SQL_ELAPSE_TIME
- GLOBAL_WORKLOAD_TRANSACTION
- GS_ALL_CONTROL_GROUP_INFO
- GS_CLUSTER_RESOURCE_INFO
- GS_INSTR_UNIQUE_SQL
- GS_REL_IOSTAT
- GS_NODE_STAT_RESET_TIME
- GS_SESSION_CPU_STATISTICS
- GS_SESSION_MEMORY_STATISTICS
- GS_SQL_COUNT
- GS_WAIT_EVENTS
- GS_WLM_OPERAROR_INFO
- GS_WLM_OPERATOR_HISTORY
- GS_WLM_OPERATOR_STATISTICS
- GS_WLM_SESSION_INFO
- GS_WLM_SESSION_HISTORY
- GS_WLM_SESSION_STATISTICS
- GS_WLM_SQL_ALLOW
- GS_WORKLOAD_SQL_COUNT
- GS_WORKLOAD_SQL_ELAPSE_TIME
- GS_WORKLOAD_TRANSACTION
- GS_STAT_DB_CU
- GS_STAT_SESSION_CU
- GS_TOTAL_NODEGROUP_MEMORY_DETAIL
- GS_USER_TRANSACTION
- GS_VIEW_DEPENDENCY
- GS_VIEW_DEPENDENCY_PATH
- GS_VIEW_INVALID
- PG_AVAILABLE_EXTENSION_VERSIONS
- PG_AVAILABLE_EXTENSIONS
- PG_BULKLOAD_STATISTICS
- PG_COMM_CLIENT_INFO
- PG_COMM_DELAY
- PG_COMM_STATUS
- PG_COMM_RECV_STREAM
- PG_COMM_SEND_STREAM
- PG_CONTROL_GROUP_CONFIG
- PG_CURSORS
- PG_EXT_STATS
- PG_GET_INVALID_BACKENDS
- PG_GET_SENDERS_CATCHUP_TIME
- PG_GROUP
- PG_INDEXES
- PG_JOB
- PG_JOB_PROC
- PG_JOB_SINGLE
- PG_LIFECYCLE_DATA_DISTRIBUTE
- PG_LOCKS
- PG_NODE_ENV
- PG_OS_THREADS
- PG_POOLER_STATUS
- PG_PREPARED_STATEMENTS
- PG_PREPARED_XACTS
- PG_QUERYBAND_ACTION
- PG_REPLICATION_SLOTS
- PG_ROLES
- PG_RULES
- PG_RUNNING_XACTS
- PG_SECLABELS
- PG_SESSION_WLMSTAT
- PG_SESSION_IOSTAT
- PG_SETTINGS
- PG_SHADOW
- PG_SHARED_MEMORY_DETAIL
- PG_STATS
- PG_STAT_ACTIVITY
- PG_STAT_ALL_INDEXES
- PG_STAT_ALL_TABLES
- PG_STAT_BAD_BLOCK
- PG_STAT_BGWRITER
- PG_STAT_DATABASE
- PG_STAT_DATABASE_CONFLICTS
- PG_STAT_GET_MEM_MBYTES_RESERVED
- PG_STAT_USER_FUNCTIONS
- PG_STAT_USER_INDEXES
- PG_STAT_USER_TABLES
- PG_STAT_REPLICATION
- PG_STAT_SYS_INDEXES
- PG_STAT_SYS_TABLES
- PG_STAT_XACT_ALL_TABLES
- PG_STAT_XACT_SYS_TABLES
- PG_STAT_XACT_USER_FUNCTIONS
- PG_STAT_XACT_USER_TABLES
- PG_STATIO_ALL_INDEXES
- PG_STATIO_ALL_SEQUENCES
- PG_STATIO_ALL_TABLES
- PG_STATIO_SYS_INDEXES
- PG_STATIO_SYS_SEQUENCES
- PG_STATIO_SYS_TABLES
- PG_STATIO_USER_INDEXES
- PG_STATIO_USER_SEQUENCES
- PG_STATIO_USER_TABLES
- PG_THREAD_WAIT_STATUS
- PG_TABLES
- PG_TDE_INFO
- PG_TIMEZONE_ABBREVS
- PG_TIMEZONE_NAMES
- PG_TOTAL_MEMORY_DETAIL
- PG_TOTAL_SCHEMA_INFO
- PG_TOTAL_USER_RESOURCE_INFO
- PG_USER
- PG_USER_MAPPINGS
- PG_VIEWS
- PG_WLM_STATISTICS
- PGXC_BULKLOAD_PROGRESS
- PGXC_BULKLOAD_STATISTICS
- PGXC_COMM_CLIENT_INFO
- PGXC_COMM_DELAY
- PGXC_COMM_RECV_STREAM
- PGXC_COMM_SEND_STREAM
- PGXC_COMM_STATUS
- PGXC_DEADLOCK
- PGXC_GET_STAT_ALL_TABLES
- PGXC_GET_STAT_ALL_PARTITIONS
- PGXC_GET_TABLE_SKEWNESS
- PGXC_GTM_SNAPSHOT_STATUS
- PGXC_INSTANCE_TIME
- PGXC_INSTR_UNIQUE_SQL
- PGXC_LOCK_CONFLICTS
- PGXC_NODE_ENV
- PGXC_NODE_STAT_RESET_TIME
- PGXC_OS_RUN_INFO
- PGXC_OS_THREADS
- PGXC_PREPARED_XACTS
- PGXC_REDO_STAT
- PGXC_REL_IOSTAT
- PGXC_REPLICATION_SLOTS
- PGXC_RUNNING_XACTS
- PGXC_SETTINGS
- PGXC_STAT_ACTIVITY
- PGXC_STAT_BAD_BLOCK
- PGXC_STAT_BGWRITER
- PGXC_STAT_DATABASE
- PGXC_STAT_REPLICATION
- PGXC_SQL_COUNT
- PGXC_THREAD_WAIT_STATUS
- PGXC_TOTAL_MEMORY_DETAIL
- PGXC_TOTAL_SCHEMA_INFO
- PGXC_TOTAL_SCHEMA_INFO_ANALYZE
- PGXC_USER_TRANSACTION
- PGXC_VARIABLE_INFO
- PGXC_WAIT_EVENTS
- PGXC_WLM_OPERATOR_HISTORY
- PGXC_WLM_OPERATOR_INFO
- PGXC_WLM_OPERATOR_STATISTICS
- PGXC_WLM_SESSION_INFO
- PGXC_WLM_SESSION_HISTORY
- PGXC_WLM_SESSION_STATISTICS
- PGXC_WLM_WORKLOAD_RECORDS
- PGXC_WORKLOAD_SQL_COUNT
- PGXC_WORKLOAD_SQL_ELAPSE_TIME
- PGXC_WORKLOAD_TRANSACTION
- PLAN_TABLE
- PLAN_TABLE_DATA
- PV_FILE_STAT
- PV_INSTANCE_TIME
- PV_OS_RUN_INFO
- PV_SESSION_MEMORY
- PV_SESSION_MEMORY_DETAIL
- PV_SESSION_STAT
- PV_SESSION_TIME
- PV_TOTAL_MEMORY_DETAIL
- PV_REDO_STAT
- REDACTION_COLUMNS
- REDACTION_POLICIES
- USER_COL_COMMENTS
- USER_CONSTRAINTS
- USER_CONS_COLUMNS
- USER_INDEXES
- USER_IND_COLUMNS
- USER_IND_EXPRESSIONS
- USER_IND_PARTITIONS
- USER_JOBS
- USER_OBJECTS
- USER_PART_INDEXES
- USER_PART_TABLES
- USER_PROCEDURES
- USER_SEQUENCES
- USER_SOURCE
- USER_SYNONYMS
- USER_TAB_COLUMNS
- USER_TAB_COMMENTS
- USER_TAB_PARTITIONS
- USER_TABLES
- USER_TRIGGERS
- USER_VIEWS
- V$SESSION
- V$SESSION_LONGOPS
- GUC参数
- 术语表
-
语法参考(吉隆坡地区)
- GaussDB(DWS) SQL
- GaussDB(DWS)与PostgreSQL的差异
- 关键字
- 数据类型
- 常量与宏
- 函数和操作符
- 表达式
- 类型转换
- 全文检索
- 系统操作
- 事务控制
-
DDL语法
- DDL语法一览表
- ALTER DATABASE
- ALTER FOREIGN TABLE (For GDS)
- ALTER FOREIGN TABLE (For HDFS or OBS)
- ALTER FUNCTION
- ALTER GROUP
- ALTER INDEX
- ALTER LARGE OBJECT
- ALTER REDACTION POLICY
- ALTER RESOURCE POOL
- ALTER ROLE
- ALTER ROW LEVEL SECURITY POLICY
- ALTER SCHEMA
- ALTER SEQUENCE
- ALTER SERVER
- ALTER SESSION
- ALTER SYNONYM
- ALTER SYSTEM KILL SESSION
- ALTER TABLE
- ALTER TABLE PARTITION
- ALTER TEXT SEARCH CONFIGURATION
- ALTER TEXT SEARCH DICTIONARY
- ALTER TRIGGER
- ALTER TYPE
- ALTER USER
- ALTER VIEW
- CLEAN CONNECTION
- CLOSE
- CLUSTER
- COMMENT
- CREATE BARRIER
- CREATE DATABASE
- CREATE FOREIGN TABLE (GDS导入导出)
- CREATE FOREIGN TABLE (SQL on OBS or Hadoop )
- CREATE FOREIGN TABLE (OBS导入导出)
- CREATE FUNCTION
- CREATE GROUP
- CREATE INDEX
- CREATE REDACTION POLICY
- CREATE ROW LEVEL SECURITY POLICY
- CREATE PROCEDURE
- CREATE RESOURCE POOL
- CREATE ROLE
- CREATE SCHEMA
- CREATE SEQUENCE
- CREATE SERVER
- CREATE SYNONYM
- CREATE TABLE
- CREATE TABLE AS
- CREATE TABLE PARTITION
- CREATE TABLESPACE
- CREATE TEXT SEARCH CONFIGURATION
- CREATE TEXT SEARCH DICTIONARY
- CREATE TRIGGER
- CREATE TYPE
- CREATE USER
- CREATE VIEW
- CURSOR
- DROP DATABASE
- DROP FOREIGN TABLE
- DROP FUNCTION
- DROP GROUP
- DROP INDEX
- DROP OWNED
- DROP REDACTION POLICY
- DROP ROW LEVEL SECURITY POLICY
- DROP PROCEDURE
- DROP RESOURCE POOL
- DROP ROLE
- DROP SCHEMA
- DROP SEQUENCE
- DROP SERVER
- DROP SYNONYM
- DROP TABLE
- DROP TABLESPACE
- DROP TEXT SEARCH CONFIGURATION
- DROP TEXT SEARCH DICTIONARY
- DROP TRIGGER
- DROP TYPE
- DROP USER
- DROP VIEW
- FETCH
- MOVE
- REINDEX
- RESET
- SET
- SET CONSTRAINTS
- SET ROLE
- SET SESSION AUTHORIZATION
- SHOW
- TRUNCATE
- VACUUM
- DML语法
- DCL语法
- DQL语法
- TCL语法
- GIN索引
-
工具指南(吉隆坡地区)
- 工具简介
- 客户端工具下载
- gsql命令行客户端工具
- Data Studio数据库集成开发工具
- GDS并行数据加载工具
- DSC SQL语法迁移工具
- 服务端工具
- 错误码参考(吉隆坡地区)
-
用户指南(阿布扎比区域)
- 性能白皮书
- 通用参考
链接复制成功!
SELECT
功能描述
SELECT用于从表或视图中读取数据。
SELECT语句就像叠加在数据库表上的过滤器,利用SQL关键字从数据表中过滤出用户需要的数据。
注意事项
- SELECT支持普通表和HDFS的Join,不支持普通表和GDS外表的join。即SELECT语句中不能同时出现普通表和GDS外表。
- 必须对每个在SELECT命令中使用的字段有SELECT权限。
- 使用FOR UPDATE或FOR SHARE还要求UPDATE权限。
- 尽量避免出现计划不下推的SQL写法(EXPLAIN输出的执行计划中出现"_REMOTE_XXX_QUERY_")。
- 尽量避免行存大表(数据量1000万行以上)的频繁COUNT查询。
- 单SQL的UNION/UNION All分支不能超过50,多表关联不能超过25张非复制表。
- 尽量避免大表关联时缺少关联条件而求笛卡尔积。
- 多表关联查询时,单个语句Stream建议控制在100以内。
- 谨慎使用递归语句(WITH RECURSIVE),需明确数据重复度和终止条件,确保递归可按预期结束。
- 更多开发设计规范参见总体开发设计规范。
语法格式
- 查询数据
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[ WITH [ RECURSIVE ] with_query [, ...] ] SELECT [/*+ plan_hint */] [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ] { * | {expression [ [ AS ] output_name ]} [, ...] } [ FROM from_item [, ...] ] [ WHERE condition ] [ GROUP BY grouping_element [, ...] ] [ HAVING condition [, ...] ] [ WINDOW {window_name AS ( window_definition )} [, ...] ] [ { UNION | INTERSECT | EXCEPT | MINUS } [ ALL | DISTINCT ] select ] [ ORDER BY {expression [ [ ASC | DESC | USING operator ] | nlssort_expression_clause ] [ NULLS { FIRST | LAST } ]} [, ...] ] [ { [ LIMIT { count | ALL } ] [ OFFSET start [ ROW | ROWS ] ] } | { LIMIT start, { count | ALL } } ] [ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ] [ {FOR { UPDATE | SHARE } [ OF table_name [, ...] ] [ NOWAIT ]} [...] ]; |
condition和expression中可以使用输出列中表达式的别名。
- 只能同一层引用。
- 只能引用输出列中的别名。
- 只能是后面的表达式引用前面的表达式。
- 不能包含volatile函数。
- 不能包含Window function函数。
- 不支持在join on条件中引用别名。
- 输出列中有多个要应用的别名则报错。
- 其中子查询with_query为:
1 2
with_query_name [ ( column_name [, ...] ) ] AS [ [ NOT ] MATERIALIZED ] ( {select | values | insert | update | delete} )
- 其中指定查询源from_item为:
1 2 3 4 5 6
{[ ONLY ] table_name [ * ] [ partition_clause ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] |( select ) [ AS ] alias [ ( column_alias [, ...] ) ] |with_query_name [ [ AS ] alias [ ( column_alias [, ...] ) ] ] |function_name ( [ argument [, ...] ] ) [ AS ] alias [ ( column_alias [, ...] | column_definition [, ...] ) ] |function_name ( [ argument [, ...] ] ) AS ( column_definition [, ...] ) |from_item [ NATURAL ] join_type from_item [ ON join_condition | USING ( join_column [, ...] ) ]}
- 其中group子句为:
1 2 3 4 5 6
( ) | expression | ( expression [, ...] ) | ROLLUP ( { expression | ( expression [, ...] ) } [, ...] ) | CUBE ( { expression | ( expression [, ...] ) } [, ...] ) | GROUPING SETS ( grouping_element [, ...] )
- 其中指定分区partition_clause为:
1 2
PARTITION { ( partition_name ) | FOR ( partition_value [, ...] ) }
说明:指定分区只适合普通表。
- 其中设置排序方式nlssort_expression_clause为:
1
NLSSORT ( column_name, ' NLS_SORT = { SCHINESE_PINYIN_M | generic_m_ci } ' )
- 简化版查询语法,功能相当于select * from table_name。
1
TABLE { ONLY {(table_name)| table_name} | table_name [ * ]};
参数说明
- WITH [ RECURSIVE ] with_query [, ...]
用于声明一个或多个可以在主查询中通过名字引用的子查询,相当于临时表。
如果声明了RECURSIVE,那么允许SELECT子查询通过名字引用它自己。
其中with_query的详细格式为:with_query_name [ ( column_name [, ...] ) ] AS [ [ NOT ] MATERIALIZED ] ( {select | values | insert | update | delete} )
- with_query_name指定子查询生成的结果集名字,在查询中可使用该名称访问子查询的结果集。
- 默认情况下,被主查询多次引用的with_query通常只被执行一次,并将其结果集进行物化,供主查询多次查询其结果集;被主查询引用一次的with_query,则不再单独执行,而是将其子查询直接替换到主查询中的引用处,随主查询一起执行。显示指定[ NOT ] MATERIALIZED,可改变默认行为:
- 指定MATERIALIZED时,将子查询执行一次,并将其结果集进行物化。
- 指定NOT MATERIALIZED时,则将其子查询替换到主查询中的引用处。以下几种情况会忽略NOT MATERIALIZED:
- 子查询中含有volatile函数。
- 子查询为含有FOR UPDATE/FOR SHARE的SELECT/VALUES语句。
- 子查询为INSERT/UPDATE/DELETE等语句。
- with_query为RECURSIVE。
- 被引用次数大于1的with_query2引用了外层自引用的with_query1,则with_query2不能被替换到引用处。
- column_name指定子查询结果集中显示的列名。
- 每个子查询可以是SELECT,VALUES,INSERT,UPDATE或DELETE语句。
- plan_hint子句
以/*+ */的形式在SELECT关键字后,用于对SELECT对应的语句块生成的计划进行hint调优,详细用法请参见章节:使用Plan Hint进行调优。
- ALL
声明返回所有符合条件的行,是默认行为,可以省略该关键字。
- DISTINCT [ ON ( expression [, ...] ) ]
从SELECT的结果集中删除所有重复的行,使结果集中的每行都是唯一的。
ON ( expression [, ...] ) 只保留那些在给出的表达式上运算出相同结果的行集合中的第一行。
须知:DISTINCT ON表达式是使用与ORDER BY相同的规则进行解释的。除非使用了ORDER BY来保证需要的行首先出现,否则,"第一行" 是不可预测的。
- SELECT列表
指定查询表中列名,可以是部分列或者是全部(使用通配符*表示)。
通过使用子句AS output_name可以为输出字段取个别名,这个别名通常用于输出字段的显示。
列名可以用下面几种形式表达:
- 手动输入列名,多个列之间用英文逗号(,)分隔。
- 可以是FROM子句里面计算出来的字段。
- FROM子句
为SELECT声明一个或者多个源表。
FROM子句涉及的元素如下所示。
- table_name
- alias
给表或复杂的表引用起一个临时的表别名,以便被其余的查询引用。
别名用于缩写或者在自连接中消除歧义。如果提供了别名,它就会完全隐藏表的实际名字。
- column_alias
- PARTITION
- partition_name
- partition_value
指定的分区键值。在创建分区表时,如果指定了多个分区键,可以通过PARTITION FOR子句指定的这一组分区键的值,唯一确定一个分区。
- subquery
- with_query_name
- function_name
- join_type
- [ INNER ] JOIN
一个JOIN子句组合两个FROM项。可使用圆括弧以决定嵌套的顺序。如果没有圆括弧,JOIN从左向右嵌套。
在任何情况下,JOIN都比逗号分隔的FROM项绑定得更紧。
- LEFT [ OUTER ] JOIN
返回笛卡尔积中所有符合连接条件的行,再加上左表中通过连接条件没有匹配到右表行的那些行。这样,左边的行将扩展为生成表的全长,方法是在那些右表对应的字段位置填上NULL。请注意,只在计算匹配的时候,才使用JOIN子句的条件,外层的条件是在计算完毕之后施加的。
- RIGHT [ OUTER ] JOIN
返回所有内连接的结果行,加上每个不匹配的右边行(左边用NULL扩展)。
这只是一个符号上的方便,因为总是可以把它转换成一个LEFT OUTER JOIN,只要把左边和右边的输入互换位置即可。
- FULL [ OUTER ] JOIN
- CROSS JOIN
CROSS JOIN等效于INNER JOIN ON(TRUE) ,即没有被条件删除的行。这种连接类型只是符号上的方便,因为它们与简单的FROM和WHERE的效果相同。
说明:必须为INNER和OUTER连接类型声明一个连接条件,即NATURAL ON,join_condition,USING (join_column [, ...]) 之一。但是它们不能出现在CROSS JOIN中。
其中CROSS JOIN和INNER JOIN生成一个简单的笛卡尔积,和在FROM的顶层列出两个项的结果相同。
- [ INNER ] JOIN
- ON join_condition
- USING(join_column[,...])
ON left_table.a = right_table.a AND left_table.b = right_table.b ... 的简写。要求对应的列必须同名。
- NATURAL
- from item
- WHERE子句
WHERE子句构成一个行选择表达式,用来缩小SELECT查询的范围。condition是返回值为布尔型的任意表达式,任何不满足该条件的行都不会被检索。
WHERE子句中可以通过指定"(+)"操作符的方法将表的连接关系转换为外连接。但是不建议用户使用这种用法,因为这并不是SQL的标准语法,在做平台迁移的时候可能面临语法兼容性的问题。同时,使用"(+)"有很多限制:
- "(+)"只能出现在where子句中。
- 如果from子句中已经有指定表连接关系,那么不能再在where子句中使用"(+)"。
- "(+)"只能作用在表或者视图的列上,不能作用在表达式上。
- 如果表A和表B有多个连接条件,那么必须在所有的连接条件中指定"(+)",否则"(+)"将不会生效,表连接会转化成内连接,并且不给出任何提示信息。
- "(+)"作用的连接条件中的表不能跨查询或者子查询。如果"(+)"作用的表,不在当前查询或者子查询的from子句中,则会报错。如果"(+)"作用的对端的表不存在,则不报错,同时连接关系会转化为内连接。
- "(+)"作用的表达式不能直接通过"OR"连接。
- 如果"(+)"作用的列是和一个常量的比较关系, 那么这个表达式会成为join条件的一部分。
- 同一个表不能对应多个外表。
- "(+)"只能出现"比较表达式","NOT表达式",“ANY表达式”,“ALL表达式”,“IN表达式”,“NULLIF表达式”,“IS DISTINCT FROM表达式”,“IS OF”表达式。"(+)"不能出现在其他类型表达式中,并且这些表达式中不允许出现通过“AND”和“OR”连接的表达式。
- "(+)"只能转化为左外连接或者右外连接,不能转化为全连接,即不能在一个表达式的两个表上同时指定"(+)"
须知:对于WHERE子句的LIKE操作符,当LIKE中要查询特殊字符“%”、“_”、“\”的时候需要使用反斜杠“\”来进行转义。
示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
CREATE TABLE tt01 (id int,content varchar(50)); INSERT INTO tt01 values (1,'Jack say ''hello'''); INSERT INTO tt01 values (2,'Rose do 50%'); INSERT INTO tt01 values (3,'Lilei say ''world'''); INSERT INTO tt01 values (4,'Hanmei do 100%'); SELECT * FROM tt01; id | content ----+------------------- 3 | Lilei say 'world' 4 | Hanmei do 100% 1 | Jack say 'hello' 2 | Rose do 50% (4 rows) SELECT * FROM tt01 WHERE content like '%''he%'; id | content ----+------------------ 1 | Jack say 'hello' (1 row) SELECT * FROM tt01 WHERE content like '%50\%%'; id | content ----+------------- 2 | Rose do 50% (1 row)
- GROUP BY子句
将查询结果按某一列或多列的值分组,值相等的为一组。
- ROLLUP ( { expression | ( expression [, ...] ) } [, ...] )
ROLLUP是计算一个有序的分组列在GROUP BY中指定的标准聚集值,然后从右到左进一步创建高层次的部分和,最后创建了累积和。一个分组能够看做一系列的分组集。例如:
1
GROUP BY ROLLUP (a,b,c)
等价于:
1
GROUP BY GROUPING SETS((a,b,c), (a,b), (a), ( ))
ROLLUP子句中的元素可以是单独的字段或表达式,也可以是使用括号包含的列表。如果是括号中的列表,产生分组集时它们必须作为一个整体。例如:
1
GROUP BY ROLLUP ((a,b), (c,d))
等价于:
1
GROUPING SETS ((a,b,c,d), (a,b), (c,d ), ( ))
- CUBE ( { expression | ( expression [, ...] ) } [, ...] )
CUBE是自动对group by子句中列出的字段进行分组汇总,结果集将包含维度列中各值的所有可能组合,以及与这些维度值组合相匹配的基础行中的聚合值。它会为每个分组返回一行汇总信息, 用户可以使用CUBE来产生交叉表值。比如,在CUBE子句中给出三个表达式(n = 3),运算结果为2n = 23 = 8组。 以n个表达式的值分组的行称为常规行,其余的行称为超级聚集行。例如:
1
GROUP BY CUBE (a,b,c)
等价于:
1
GROUP BY GROUPING SETS((a,b,c), (a,b), (a,c), (b,c), (a), (b), (c), ( ))
CUBE子句中的元素可以是单独的字段或表达式,也可以是使用括号包含的列表。如果是括号中的列表,产生分组集时它们必须作为一个整体。例如:
1
GROUP BY CUBE (a, (b, c), d)
等价于:
GROUP BY GROUPING SETS ((a,b,c,d), (a,b,c), (a), ( ))
- GROUPING SETS ( grouping_element [, ...] )
GROUPING SETS子句是GROUP BY子句的进一步扩展,它可以使用户指定多个GROUP BY选项。选项用于定义分组集,每个分组集都需要包含在单独的括号中,空白的括号(())表示将所有数据当作一个组处理。 这样做可以通过裁剪用户不需要的数据组来提高效率。 用户可以根据需要指定所需的数据组进行查询。
须知:如果SELECT列表的表达式中引用了那些没有分组的字段,则会报错,除非使用了聚集函数,因为对于未分组的字段,可能返回多个数值。
- ROLLUP ( { expression | ( expression [, ...] ) } [, ...] )
- HAVING子句
与GROUP BY子句配合用来选择特殊的组。HAVING子句将组的一些属性与一个常数值比较,只有满足HAVING子句中的逻辑表达式的组才会被提取出来。
- WINDOW子句
一般形式为WINDOW window_name AS ( window_definition ) [, ...],window_name是可以被随后的窗口定义所引用的名称,window_definition可以是以下的形式:
[ existing_window_name ]
[ PARTITION BY expression [, ...] ]
[ ORDER BY expression [ ASC | DESC | USING operator ] [ NULLS { FIRST | LAST } ] [, ...] ]
[ frame_clause ]
frame_clause为窗函数定义一个窗口框架window frame,窗函数(并非所有)依赖于框架,window frame是当前查询行的一组相关行。frame_clause可以是以下的形式:
[ RANGE | ROWS ] frame_start
[ RANGE | ROWS ] BETWEEN frame_start AND frame_end
frame_start和frame_end可以是:
UNBOUNDED PRECEDING
value PRECEDING(RANGE不支持)
CURRENT ROW
value FOLLOWING(RANGE不支持)
UNBOUNDED FOLLOWING
须知:对列存表的查询目前只支持row_number窗口函数,不支持frame_clause。
- UNION子句
UNION计算多个SELECT语句返回行集合的并集。
UNION子句有如下约束条件:
- 除非声明了ALL子句,否则缺省的UNION结果不包含重复的行。
- 同一个SELECT语句中的多个UNION操作符是从左向右计算的,除非用圆括弧进行了标识。
- FOR UPDATE不能在UNION的结果或输入中声明。
一般表达式:
select_statement UNION [ALL] select_statement
- select_statement可以是任何没有ORDER BY、LIMIT、FOR UPDATE子句的SELECT语句。
- 如果用圆括弧包围,ORDER BY和LIMIT可以附着在子表达式里。
- INTERSECT子句
INTERSECT计算多个SELECT语句返回行集合的交集,不含重复的记录。
INTERSECT子句有如下约束条件:
- 同一个SELECT语句中的多个INTERSECT操作符是从左向右计算的,除非用圆括弧进行了标识。
- 当对多个SELECT语句的执行结果进行UNION和INTERSECT操作的时候,会优先处理INTERSECT。
一般形式:
select_statement INTERSECT select_statement
select_statement可以是任何没有FOR UPDATE子句的SELECT语句。
- EXCEPT子句
EXCEPT子句有如下的通用形式:
select_statement EXCEPT [ ALL ] select_statement
select_statement是任何没有FOR UPDATE子句的SELECT表达式。
EXCEPT操作符计算存在于左边SELECT语句的输出而不存在于右边SELECT语句输出的行。
EXCEPT的结果不包含任何重复的行,除非声明了ALL选项。使用ALL时,一个在左边表中有m个重复而在右边表中有n个重复的行将在结果中出现max(m-n,0) 次。
除非用圆括弧指明顺序,否则同一个SELECT语句中的多个EXCEPT操作符是从左向右计算的。EXCEPT和UNION的绑定级别相同。
目前,不能给EXCEPT的结果或者任何EXCEPT的输入声明FOR UPDATE子句。
- MINUS子句
与EXCEPT子句具有相同的功能和用法。
- ORDER BY子句
对SELECT语句检索得到的数据进行升序或降序排序。对于ORDER BY表达式中包含多列的情况:
- 首先根据最左边的列进行排序,如果这一列的值相同,则根据下一个表达式进行比较,以此类推。
- 如果对于所有声明的表达式都相同,则按随机顺序返回。
- ORDER BY中排序的列必须包括在SELECT语句所检索的结果集的列中。
- [ { [ LIMIT { count | ALL } ] [ OFFSET start [ ROW | ROWS ] ] } | { LIMIT start, { count | ALL } } ]
LIMIT子句由两个独立的Limit子句、Offset子句和一个多参Limit子句构成:
LIMIT { count | ALL }
OFFSET start [ ROW | ROWS ]
LIMIT start, { count | ALL }
其中,count声明返回的最大行数,而start声明开始返回行之前忽略的行数。如果这两个参数都指定了,会在开始计算count个返回行之前先跳过start行。多参Limit子句不可和单参的Limit子句或Offset子句共同出现。
- FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY
如果不指定count,默认值为1,FETCH子句限定返回查询结果从第一行开始的总行数。
- FOR UPDATE子句
FOR UPDATE子句将对SELECT检索出来的行进行加锁。这样避免它们在当前事务结束前被其他事务修改或者删除,即其他企图UPDATE、 DELETE、 SELECT FOR UPDATE这些行的事务将被阻塞,直到当前事务结束。
为了避免操作等待其他事务提交,可使用NOWAIT选项,如果被选择的行不能立即被锁住,执行SELECT FOR UPDATE NOWAIT将会立即汇报一个错误,而不是等待。
FOR SHARE的行为类似,只是它在每个检索出来的行上要求一个共享锁,而不是一个排他锁。一个共享锁阻塞其它事务执行UPDATE、DELETE、SELECT,不阻塞SELECT FOR SHARE。
如果在FOR UPDATE或FOR SHARE中明确指定了表名字,则只有这些指定的表被锁定,其他在SELECT中使用的表将不会被锁定。否则,将锁定该命令中所有使用的表。
如果FOR UPDATE或FOR SHARE应用于一个视图或者子查询,它同样将锁定所有该视图或子查询中使用到的表。
多个FOR UPDATE和FOR SHARE子句可以用于为不同的表指定不同的锁定模式。
如果一个表中同时出现(或隐含同时出现)在FOR UPDATE和FOR SHARE子句中,则按照FOR UPDATE处理。类似的,如果影响一个表的任意子句中出现了NOWAIT,该表将按照NOWAIT处理。
须知:- 对于for update/share,执行计划不能下推的SQL,直接返回报错信息;对于执行计划可以下推的,下推到DN执行。
- 对列存表的查询不支持for update/share。
- NLS_SORT
指定某字段按照特殊方式排序。目前仅支持中文拼音格式排序和不区分大小写排序。
取值范围:
- SCHINESE_PINYIN_M,按照中文拼音排序(目前只支持GBK字符集内的一级汉字排序)。如果要支持此排序方式,在创建数据库时需要指定编码格式为“GBK”,否则排序无效。
- generic_m_ci,不区分大小写排序。
- PARTITION子句
查询某个分区表中相应分区的数据。
示例
先通过子查询得到一张临时表temp_t,然后查询表temp_t中的所有数据。
1 |
WITH temp_t(name,isdba) AS (SELECT usename,usesuper FROM pg_user) SELECT * FROM temp_t; |
为名为temp_t的with_query显示指定MATERIALIZED,然后查询表temp_t中的所有数据。
1 |
WITH temp_t(name,isdba) AS MATERIALIZED (SELECT usename,usesuper FROM pg_user) SELECT * FROM temp_t; |
为名为temp_t的with_query显示指定NOT MATERIALIZED,然后查询表temp_t中的所有数据。
1 2 3 4 |
WITH temp_t(name,isdba) AS NOT MATERIALIZED (SELECT usename,usesuper FROM pg_user) SELECT * FROM temp_t t1 WHERE name LIKE 'A%' UNION ALL SELECT * FROM temp_t t2 WHERE name LIKE 'B%'; |
查询tpcds.reason表的所有r_reason_sk记录,且去除重复。
1 |
SELECT DISTINCT(r_reason_sk) FROM tpcds.reason; |
LIMIT子句示例:获取表中一条记录。
1 |
SELECT * FROM tpcds.reason LIMIT 1; |
LIMIT子句示例:获取表中第三条记录。
1 |
SELECT * FROM tpcds.reason LIMIT 1 OFFSET 2; |
LIMIT子句示例:获取表中前两条记录。
1 |
SELECT * FROM tpcds.reason LIMIT 2; |
查询所有记录,且按字母升序排列。
1 |
SELECT r_reason_desc FROM tpcds.reason ORDER BY r_reason_desc; |
通过表别名,从pg_user和pg_user_status这两张表中获取数据。
1 |
SELECT a.usename,b.locktime FROM pg_user a,pg_user_status b WHERE a.usesysid=b.roloid; |
FULL JOIN子句示例:将pg_user和pg_user_status这两张表的数据进行全连接显示,即数据的合集。
1 |
SELECT a.usename,b.locktime,a.usesuper FROM pg_user a FULL JOIN pg_user_status b on a.usesysid=b.roloid; |
GROUP BY子句示例:根据查询条件过滤,并对结果进行分组。
1 |
SELECT r_reason_id, AVG(r_reason_sk) FROM tpcds.reason GROUP BY r_reason_id HAVING AVG(r_reason_sk) > 25; |
GROUP BY子句示例:通过group by别名来对结果进行分组。
1 |
SELECT r_reason_id AS id FROM tpcds.reason GROUP BY id; |
GROUP BY CUBE子句示例:根据查询条件过滤,并对结果进行分组汇总。
1 |
SELECT r_reason_id,AVG(r_reason_sk) FROM tpcds.reason GROUP BY CUBE(r_reason_id,r_reason_sk); |
GROUP BY GROUPING SETS子句示例:根据查询条件过滤,并对结果进行分组汇总。
1 |
SELECT r_reason_id,AVG(r_reason_sk) FROM tpcds.reason GROUP BY GROUPING SETS((r_reason_id,r_reason_sk),r_reason_sk); |
UNION子句示例:将表tpcds.reason里r_reason_desc字段中的内容以W开头和以N开头的进行合并。
1 2 3 4 5 6 7 |
SELECT r_reason_sk, tpcds.reason.r_reason_desc FROM tpcds.reason WHERE tpcds.reason.r_reason_desc LIKE 'W%' UNION SELECT r_reason_sk, tpcds.reason.r_reason_desc FROM tpcds.reason WHERE tpcds.reason.r_reason_desc LIKE 'N%'; |
1 2 3 4 5 6 7 8 |
CREATE TABLE stu_pinyin_info (id bigint, name text) DISTRIBUTE BY REPLICATION; INSERT INTO stu_pinyin_info VALUES (1, '雷锋'),(2, '石传祥'); SELECT * FROM stu_pinyin_info ORDER BY NLSSORT (name, 'NLS_SORT = SCHINESE_PINYIN_M' ); id | name ----+-------- 2 | 石传祥 1 | 雷锋 (2 rows) |
1 2 3 4 5 6 7 8 |
CREATE TABLE stu_icase_info (id bigint, name text) DISTRIBUTE BY REPLICATION; INSERT INTO stu_icase_info VALUES (1, 'aaaa'),(2, 'AAAA'); SELECT * FROM stu_icase_info ORDER BY NLSSORT (name, 'NLS_SORT = generic_m_ci'); id | name ----+------ 1 | aaaa 2 | AAAA (2 rows) |
创建分区表tpcds.reason_p,并插入数据,再从tpcds.reason_p的表分区P_05_BEFORE中获取数据。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
CREATE TABLE tpcds.reason_p ( r_reason_sk integer, r_reason_id character(16), r_reason_desc character(100) ) PARTITION BY RANGE (r_reason_sk) ( partition P_05_BEFORE values less than (05), partition P_15 values less than (15), partition P_25 values less than (25), partition P_35 values less than (35), partition P_45_AFTER values less than (MAXVALUE) ); INSERT INTO tpcds.reason_p values(3,'AAAAAAAABAAAAAAA','reason 1'),(10,'AAAAAAAABAAAAAAA','reason 2'),(4,'AAAAAAAABAAAAAAA','reason 3'),(10,'AAAAAAAABAAAAAAA','reason 4'),(10,'AAAAAAAABAAAAAAA','reason 5'),(20,'AAAAAAAACAAAAAAA','reason 6'),(30,'AAAAAAAACAAAAAAA','reason 7'); SELECT * FROM tpcds.reason_p PARTITION (P_05_BEFORE); r_reason_sk | r_reason_id | r_reason_desc -------------+------------------+------------------------------------ 4 | AAAAAAAABAAAAAAA | reason 3 3 | AAAAAAAABAAAAAAA | reason 1 (2 rows) ——查询分区P_15的行数: SELECT count(*) FROM tpcds.reason_p PARTITION (P_15); count -------- 3 (1 row) |
GROUP BY子句示例:按r_reason_id分组统计tpcds.reason_p表中的记录数。
1 2 3 4 5 6 |
SELECT COUNT(*),r_reason_id FROM tpcds.reason_p GROUP BY r_reason_id; count | r_reason_id -------+------------------ 2 | AAAAAAAACAAAAAAA 5 | AAAAAAAABAAAAAAA (2 rows) |
GROUP BY CUBE子句示例:根据查询条件过滤,并对查询结果分组汇总。
1 |
SELECT * FROM tpcds.reason GROUP BY CUBE (r_reason_id,r_reason_sk,r_reason_desc); |
GROUP BY GROUPING SETS子句示例:根据查询条件过滤,并对查询结果分组汇总。
1 |
SELECT * FROM tpcds.reason GROUP BY GROUPING SETS ((r_reason_id,r_reason_sk),r_reason_desc); |
HAVING子句示例:按r_reason_id分组统计tpcds.reason_p表中的记录,并只显示r_reason_id个数大于2的信息。
1 2 3 4 5 |
SELECT COUNT(*) c,r_reason_id FROM tpcds.reason_p GROUP BY r_reason_id HAVING c>2; c | r_reason_id ---+------------------ 5 | AAAAAAAABAAAAAAA (1 row) |
IN子句示例:按r_reason_id分组统计tpcds.reason_p表中的r_reason_id个数,并只显示r_reason_id值为AAAAAAAABAAAAAAA或AAAAAAAADAAAAAAA的个数。
1 2 3 4 5 |
SELECT COUNT(*),r_reason_id FROM tpcds.reason_p GROUP BY r_reason_id HAVING r_reason_id IN('AAAAAAAABAAAAAAA','AAAAAAAADAAAAAAA'); count | r_reason_id -------+------------------ 5 | AAAAAAAABAAAAAAA (1 row) |
INTERSECT子句示例:查询r_reason_id等于AAAAAAAABAAAAAAA,并且r_reason_sk小于5的信息。
1 2 3 4 5 6 |
SELECT * FROM tpcds.reason_p WHERE r_reason_id='AAAAAAAABAAAAAAA' INTERSECT SELECT * FROM tpcds.reason_p WHERE r_reason_sk<5; r_reason_sk | r_reason_id | r_reason_desc -------------+------------------+------------------------------------ 4 | AAAAAAAABAAAAAAA | reason 3 3 | AAAAAAAABAAAAAAA | reason 1 (2 rows) |
EXCEPT子句示例:查询r_reason_id等于AAAAAAAABAAAAAAA,并且去除r_reason_sk小于4的信息。
1 2 3 4 5 6 7 8 |
SELECT * FROM tpcds.reason_p WHERE r_reason_id='AAAAAAAABAAAAAAA' EXCEPT SELECT * FROM tpcds.reason_p WHERE r_reason_sk<4; r_reason_sk | r_reason_id | r_reason_desc -------------+------------------+------------------------------------ 10 | AAAAAAAABAAAAAAA | reason 2 10 | AAAAAAAABAAAAAAA | reason 5 10 | AAAAAAAABAAAAAAA | reason 4 4 | AAAAAAAABAAAAAAA | reason 3 (4 rows) |
通过在where子句中指定"(+)"来实现左连接。
1 2 3 4 5 6 |
select t1.sr_item_sk ,t2.c_customer_id from store_returns t1, customer t2 where t1.sr_customer_sk = t2.c_customer_sk(+) order by 1 desc limit 1; sr_item_sk | c_customer_id ------------+--------------- 18000 | (1 row) |
通过在where子句中指定"(+)"来实现右连接。
1 2 3 4 5 6 |
select t1.sr_item_sk ,t2.c_customer_id from store_returns t1, customer t2 where t1.sr_customer_sk(+) = t2.c_customer_sk order by 1 desc limit 1; sr_item_sk | c_customer_id ------------+------------------ | AAAAAAAAJNGEBAAA (1 row) |
通过在where子句中指定"(+)"来实现左连接,并且增加连接条件。
1 2 3 4 5 |
select t1.sr_item_sk ,t2.c_customer_id from store_returns t1, customer t2 where t1.sr_customer_sk = t2.c_customer_sk(+) and t2.c_customer_sk(+) < 1 order by 1 limit 1; sr_item_sk | c_customer_id ------------+--------------- 1 | (1 row) |
不支持在where子句中指定"(+)"的同时使用内层嵌套AND/OR的表达式。
1 2 3 |
select t1.sr_item_sk ,t2.c_customer_id from store_returns t1, customer t2 where not(t1.sr_customer_sk = t2.c_customer_sk(+) and t2.c_customer_sk(+) < 1); ERROR: Operator "(+)" can not be used in nesting expression. LINE 1: ...tomer_id from store_returns t1, customer t2 where not(t1.sr_... |
where子句在不支持表达式宏指定"(+)"会报错。
1 2 |
select t1.sr_item_sk ,t2.c_customer_id from store_returns t1, customer t2 where (t1.sr_customer_sk = t2.c_customer_sk(+))::bool; ERROR: Operator "(+)" can only be used in common expression. |
where子句在表达式的两边都指定"(+)"会报错。
1 2 3 |
select t1.sr_item_sk ,t2.c_customer_id from store_returns t1, customer t2 where t1.sr_customer_sk(+) = t2.c_customer_sk(+); ERROR: Operator "(+)" can't be specified on more than one relation in one join condition HINT: "t1", "t2"...are specified Operator "(+)" in one condition. |