Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
cbed4063
Commit
cbed4063
authored
26 years ago
by
Thomas G. Lockhart
Browse files
Options
Downloads
Patches
Plain Diff
Small sentence cleanups. Add tags for acronyms and products.
parent
4e767530
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/keys.sgml
+17
-12
17 additions, 12 deletions
doc/src/sgml/keys.sgml
with
17 additions
and
12 deletions
doc/src/sgml/keys.sgml
+
17
−
12
View file @
cbed4063
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/keys.sgml,v 1.
1
1998/08/1
5 06:52:0
3 thomas Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/keys.sgml,v 1.
2
1998/08/1
7 16:18:1
3 thomas Exp $
Indices and Keys
Indices and Keys
$Log: keys.sgml,v $
$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
Revision 1.1 1998/08/15 06:52:03 thomas
Nice exposition on indices and keys from Herouth Maoz which appeared
Nice exposition on indices and keys from Herouth Maoz which appeared
on the mailing lists a while ago. Maybe slightly changed to fit docs.
on the mailing lists a while ago. Maybe slightly changed to fit docs.
...
@@ -48,9 +51,9 @@ Subject: Re: [QUESTIONS] PRIMARY KEY | UNIQUE
...
@@ -48,9 +51,9 @@ Subject: Re: [QUESTIONS] PRIMARY KEY | UNIQUE
PRIMARY KEY(fields,...) and
PRIMARY KEY(fields,...) and
UNIQUE (fields,...)
UNIQUE (fields,...)
- Is this an alias
?
- Is this an alias?
- If PRIMARY KEY is already unique, then why
- 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>
</ProgramListing>
<Para>
<Para>
...
@@ -131,16 +134,18 @@ NULLs are acceptable.
...
@@ -131,16 +134,18 @@ NULLs are acceptable.
</itemizedlist>
</itemizedlist>
<Para>
<Para>
As for why no non-unique keys are specifiable by SQL syntax? Well - you
As for why no non-unique keys are defined explicitly in standard <acronym>SQL</acronym> syntax?
must understand that indexes are implementation-dependent. SQL does not
Well, you
must understand that indices are implementation-dependent. <acronym>SQL</acronym> does not
define the implementation, merely the relations between data in the
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>
<Para>
<Para>
Thus, you may query a table by any combination of its columns, despite the
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
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
an implementational aid which each
<acronym>RDBMS</acronym>
offers you, in order to cause
commonly used queries to be done more efficiently. Some
RDBMS
may give you
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
additional measures, such as keeping a key stored in main memory. They will
have a special command, for example
have a special command, for example
<programlisting>
<programlisting>
...
@@ -150,7 +155,7 @@ CREATE MEMSTORE ON <table> COLUMNS <cols>
...
@@ -150,7 +155,7 @@ CREATE MEMSTORE ON <table> COLUMNS <cols>
</Para>
</Para>
<Para>
<Para>
In fact, when you create a primary key or a unique combination of fields,
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
the retrieval of data by the key is going to be more efficient than a
sequential scan!
sequential scan!
</Para>
</Para>
...
@@ -158,9 +163,9 @@ sequential scan!
...
@@ -158,9 +163,9 @@ sequential scan!
So, if you want to use a combination of fields which is not unique as a
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
secondary key, you really don't have to specify anything - just start
retrieving by that combination! However, if you want to make the retrieval
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
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
RDBMS
- be it an index, my imaginary MEMSTORE command, or an intelligent
<acronym>RDBMS</acronym>
which crates indices without your knowledge based on the fact that you have
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
sent it many queries based on a specific combination of keys... (It learns
from experience).
from experience).
</Para>
</Para>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment