Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcbed406

Browse files
author
Thomas G. Lockhart
committed
Small sentence cleanups. Add tags for acronyms and products.
1 parent4e76753 commitcbed406

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

‎doc/src/sgml/keys.sgml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/keys.sgml,v 1.1 1998/08/15 06:52:03 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/keys.sgml,v 1.2 1998/08/17 16:18:13 thomas Exp $
33
Indices and Keys
44

55
$Log: keys.sgml,v $
6+
Revision 1.2 1998/08/17 16:18:13 thomas
7+
Small sentence cleanups. Add tags for acronyms and products.
8+
69
Revision 1.1 1998/08/15 06:52:03 thomas
710
Nice exposition on indices and keys from Herouth Maoz which appeared
811
on the mailing lists a while ago. Maybe slightly changed to fit docs.
@@ -48,9 +51,9 @@ Subject: Re: [QUESTIONS] PRIMARY KEY | UNIQUE
4851
PRIMARY KEY(fields,...) and
4952
UNIQUE (fields,...)
5053

51-
- Is this an alias?
54+
- Is this an alias?
5255
- If PRIMARY KEY is already unique, then why
53-
there's another kind of key named UNIQUE?
56+
isthere another kind of key named UNIQUE?
5457
</ProgramListing>
5558

5659
<Para>
@@ -131,16 +134,18 @@ NULLs are acceptable.
131134
</itemizedlist>
132135

133136
<Para>
134-
As for why no non-unique keys are specifiable by SQL syntax? Well - you
135-
must understand that indexes are implementation-dependent. SQL does not
137+
As for why no non-unique keys are defined explicitly in standard <acronym>SQL</acronym> syntax?
138+
Well, you
139+
must understand that indices are implementation-dependent. <acronym>SQL</acronym> does not
136140
define the implementation, merely the relations between data in the
137-
database.
141+
database. <productname>Postgres</productname> does allow non-unique indices, but indices
142+
used to enforce <acronym>SQL</acronym> keys are always unique.
138143
</Para>
139144
<Para>
140145
Thus, you may query a table by any combination of its columns, despite the
141146
fact that you don't have an index on these columns. The indexes are merely
142-
an implementational aid which each RDBMS offers you, in order to cause
143-
commonly used queries to be done more efficiently. Some RDBMS may give you
147+
an implementational aid which each<acronym>RDBMS</acronym> offers you, in order to cause
148+
commonly used queries to be done more efficiently. Some<acronym>RDBMS</acronym> may give you
144149
additional measures, such as keeping a key stored in main memory. They will
145150
have a special command, for example
146151
<programlisting>
@@ -150,17 +155,17 @@ CREATE MEMSTORE ON &lt;table&gt; COLUMNS &lt;cols&gt;
150155
</Para>
151156
<Para>
152157
In fact, when you create a primary key or a unique combination of fields,
153-
nowhere in the SQL specification does it say that an index is created, nor that
158+
nowhere in the<acronym>SQL</acronym> specification does it say that an index is created, nor that
154159
the retrieval of data by the key is going to be more efficient than a
155160
sequential scan!
156161
</Para>
157162
<Para>
158163
So, if you want to use a combination of fields which is not unique as a
159164
secondary key, you really don't have to specify anything - just start
160165
retrieving by that combination! However, if you want to make the retrieval
161-
efficient, you'll have to resort to the means your RDBMS provider gives you
162-
- be it an index, my imaginary MEMSTORE command, or an intelligent RDBMS
163-
whichcrates indices without your knowledge based on the fact that you have
166+
efficient, you'll have to resort to the means your<acronym>RDBMS</acronym> provider gives you
167+
- be it an index, my imaginary MEMSTORE command, or an intelligent<acronym>RDBMS</acronym>
168+
whichcreates indices without your knowledge based on the fact that you have
164169
sent it many queries based on a specific combination of keys... (It learns
165170
from experience).
166171
</Para>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp