Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
146c83c0
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
146c83c0
编写于
4月 06, 2007
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix some now-obsolete comments about the space used by various data
types.
上级
e1f1a535
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
19 deletion
+28
-19
doc/src/sgml/array.sgml
doc/src/sgml/array.sgml
+3
-3
doc/src/sgml/datatype.sgml
doc/src/sgml/datatype.sgml
+25
-16
未找到文件。
doc/src/sgml/array.sgml
浏览文件 @
146c83c0
<!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.
59 2007/03/02 06:01:01
tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.
60 2007/04/06 19:22:38
tgl Exp $ -->
<sect1 id="arrays">
<title>Arrays</title>
...
...
@@ -10,8 +10,8 @@
<para>
<productname>PostgreSQL</productname> allows columns of a table to be
defined as variable-length multidimensional arrays. Arrays of any
built-in or user-defined base type
can be created. (Arrays of
composite types or domains are not yet supported, however.)
built-in or user-defined base type
or enum type can be created.
(Arrays of
composite types or domains are not yet supported, however.)
</para>
<sect2>
...
...
doc/src/sgml/datatype.sgml
浏览文件 @
146c83c0
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.19
4 2007/04/05 01:46:27 momjian
Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.19
5 2007/04/06 19:22:38 tgl
Exp $ -->
<chapter id="datatype">
<title id="datatype-title">Data Types</title>
...
...
@@ -516,7 +516,7 @@ NUMERIC
type is more akin to <type>varchar(<replaceable>n</>)</type>
than to <type>char(<replaceable>n</>)</type>.) The actual storage
requirement is two bytes for each group of four decimal digits,
plus eight bytes overhead.
plus
five to
eight bytes overhead.
</para>
<indexterm>
...
...
@@ -842,9 +842,9 @@ ALTER SEQUENCE <replaceable class="parameter">tablename</replaceable>_<replaceab
<tbody>
<row>
<entry>money</entry>
<entry>
4
bytes</entry>
<entry>
8
bytes</entry>
<entry>currency amount</entry>
<entry>-
21474836.48 to +21474836.4
7</entry>
<entry>-
92233720368547758.08 to +92233720368547758.0
7</entry>
</row>
</tbody>
</tgroup>
...
...
@@ -975,12 +975,13 @@ ALTER SEQUENCE <replaceable class="parameter">tablename</replaceable>_<replaceab
</para>
<para>
The storage requirement for data of these types is 4 bytes plus the
actual string, and in case of <type>character</type> plus the
padding. Long strings are compressed by the system automatically, so
the physical requirement on disk might be less. Long values are also
stored in background tables so they do not interfere with rapid
access to the shorter column values. In any case, the longest
The storage requirement for a short string (up to 126 bytes) is 1 byte
plus the actual string, which includes the space padding in the case of
<type>character</type>. Longer strings have 4 bytes overhead instead
of 1. Long strings are compressed by the system automatically, so
the physical requirement on disk might be less. Very long values are also
stored in background tables so that they do not interfere with rapid
access to shorter column values. In any case, the longest
possible character string that can be stored is about 1 GB. (The
maximum value that will be allowed for <replaceable>n</> in the data
type declaration is less than that. It wouldn't be very useful to
...
...
@@ -994,8 +995,10 @@ ALTER SEQUENCE <replaceable class="parameter">tablename</replaceable>_<replaceab
<tip>
<para>
There are no performance differences between these three types,
apart from the increased storage size when using the blank-padded
type. While <type>character(<replaceable>n</>)</type> has performance
apart from increased storage size when using the blank-padded
type, and a few extra cycles to check the length when storing into
a length-constrained column. While
<type>character(<replaceable>n</>)</type> has performance
advantages in some other database systems, it has no such advantages in
<productname>PostgreSQL</productname>. In most situations
<type>text</type> or <type>character varying</type> should be used
...
...
@@ -1080,7 +1083,7 @@ SELECT b, char_length(b) FROM test2;
<row>
<entry><type>"char"</type></entry>
<entry>1 byte</entry>
<entry>single-
character
internal type</entry>
<entry>single-
byte
internal type</entry>
</row>
<row>
<entry><type>name</type></entry>
...
...
@@ -1122,7 +1125,7 @@ SELECT b, char_length(b) FROM test2;
<tbody>
<row>
<entry><type>bytea</type></entry>
<entry>4 bytes plus the actual binary string</entry>
<entry>
1 or
4 bytes plus the actual binary string</entry>
<entry>variable-length binary string</entry>
</row>
</tbody>
...
...
@@ -2879,13 +2882,13 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
<row>
<entry><type>cidr</type></entry>
<entry>
12 or 24
bytes</entry>
<entry>
7 or 19
bytes</entry>
<entry>IPv4 and IPv6 networks</entry>
</row>
<row>
<entry><type>inet</type></entry>
<entry>
12 or 24
bytes</entry>
<entry>
7 or 19
bytes</entry>
<entry>IPv4 and IPv6 hosts and networks</entry>
</row>
...
...
@@ -3188,6 +3191,12 @@ SELECT * FROM test;
</programlisting>
</example>
<para>
A bit string value requires 1 byte for each group of 8 bits, plus
5 or 8 bytes overhead depending on the length of the string
(but long values may be compressed or moved out-of-line, as explained
in <xref linkend="datatype-character"> for character strings).
</para>
</sect1>
<sect1 id="datatype-xml">
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录