Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
cbed4063
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,发现更多精彩内容 >>
提交
cbed4063
编写于
8月 17, 1998
作者:
T
Thomas G. Lockhart
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small sentence cleanups. Add tags for acronyms and products.
上级
4e767530
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
12 deletion
+17
-12
doc/src/sgml/keys.sgml
doc/src/sgml/keys.sgml
+17
-12
未找到文件。
doc/src/sgml/keys.sgml
浏览文件 @
cbed4063
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/keys.sgml,v 1.
1 1998/08/15 06:52:0
3 thomas Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/keys.sgml,v 1.
2 1998/08/17 16:18:1
3 thomas Exp $
Indices and Keys
$Log: keys.sgml,v $
Revision 1.2 1998/08/17 16:18:13 thomas
Small sentence cleanups. Add tags for acronyms and products.
Revision 1.1 1998/08/15 06:52:03 thomas
Nice exposition on indices and keys from Herouth Maoz which appeared
on the mailing lists a while ago. Maybe slightly changed to fit docs.
...
...
@@ -48,9 +51,9 @@ Subject: Re: [QUESTIONS] PRIMARY KEY | UNIQUE
PRIMARY KEY(fields,...) and
UNIQUE (fields,...)
- Is this an alias
?
- Is this an alias?
- If PRIMARY KEY is already unique, then why
there's another kind of key named UNIQUE
?
is there another kind of key named UNIQUE
?
</ProgramListing>
<Para>
...
...
@@ -131,16 +134,18 @@ NULLs are acceptable.
</itemizedlist>
<Para>
As for why no non-unique keys are specifiable by SQL syntax? Well - you
must understand that indexes are implementation-dependent. SQL does not
As for why no non-unique keys are defined explicitly in standard <acronym>SQL</acronym> syntax?
Well, you
must understand that indices are implementation-dependent. <acronym>SQL</acronym> does not
define the implementation, merely the relations between data in the
database.
database. <productname>Postgres</productname> does allow non-unique indices, but indices
used to enforce <acronym>SQL</acronym> keys are always unique.
</Para>
<Para>
Thus, you may query a table by any combination of its columns, despite the
fact that you don't have an index on these columns. The indexes are merely
an implementational aid which each
RDBMS
offers you, in order to cause
commonly used queries to be done more efficiently. Some
RDBMS
may give you
an implementational aid which each
<acronym>RDBMS</acronym>
offers you, in order to cause
commonly used queries to be done more efficiently. Some
<acronym>RDBMS</acronym>
may give you
additional measures, such as keeping a key stored in main memory. They will
have a special command, for example
<programlisting>
...
...
@@ -150,7 +155,7 @@ CREATE MEMSTORE ON <table> COLUMNS <cols>
</Para>
<Para>
In fact, when you create a primary key or a unique combination of fields,
nowhere in the
SQL
specification does it say that an index is created, nor that
nowhere in the
<acronym>SQL</acronym>
specification does it say that an index is created, nor that
the retrieval of data by the key is going to be more efficient than a
sequential scan!
</Para>
...
...
@@ -158,9 +163,9 @@ sequential scan!
So, if you want to use a combination of fields which is not unique as a
secondary key, you really don't have to specify anything - just start
retrieving by that combination! However, if you want to make the retrieval
efficient, you'll have to resort to the means your
RDBMS
provider gives you
- be it an index, my imaginary MEMSTORE command, or an intelligent
RDBMS
which crates indices without your knowledge based on the fact that you have
efficient, you'll have to resort to the means your
<acronym>RDBMS</acronym>
provider gives you
- be it an index, my imaginary MEMSTORE command, or an intelligent
<acronym>RDBMS</acronym>
which cr
e
ates indices without your knowledge based on the fact that you have
sent it many queries based on a specific combination of keys... (It learns
from experience).
</Para>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录