Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
48322916
Commit
48322916
authored
Aug 26, 2010
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explain automatic creation (or lack of it) of indexes for the various types
of constraints. Kevin Grittner
parent
16567b05
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
doc/src/sgml/ddl.sgml
doc/src/sgml/ddl.sgml
+26
-1
No files found.
doc/src/sgml/ddl.sgml
View file @
48322916
<
!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.9
6 2010/08/23 02:43:2
5 tgl Exp $ -->
<
!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.9
7 2010/08/26 21:08:3
5 tgl Exp $ -->
<
chapter
id
=
"ddl"
>
<
title
>
Data
Definition
</
title
>
...
...
@@ -544,6 +544,11 @@ CREATE TABLE products (
</
programlisting
>
</
para
>
<
para
>
Adding
a
unique
constraint
will
automatically
create
a
unique
btree
index
on
the
column
or
group
of
columns
used
in
the
constraint
.
</
para
>
<
indexterm
>
<
primary
>
null
value
</
primary
>
<
secondary
sortas
=
"unique constraints"
>
with
unique
constraints
</
secondary
>
...
...
@@ -622,6 +627,11 @@ CREATE TABLE example (
uniquely
.
</
para
>
<
para
>
Adding
a
primary
key
will
automatically
create
a
unique
btree
index
on
the
column
or
group
of
columns
used
in
the
primary
key
.
</
para
>
<
para
>
A
table
can
have
at
most
one
primary
key
.
(
There
can
be
any
number
of
unique
and
not
-
null
constraints
,
which
are
functionally
the
same
...
...
@@ -831,6 +841,16 @@ CREATE TABLE order_items (
column
is
changed
(
updated
).
The
possible
actions
are
the
same
.
</
para
>
<
para
>
Since
a
<
command
>
DELETE
</
command
>
of
a
row
from
the
referenced
table
or
an
<
command
>
UPDATE
</
command
>
of
a
referenced
column
will
require
a
scan
of
the
referencing
table
for
rows
matching
the
old
value
,
it
is
often
a
good
idea
to
index
the
referencing
columns
.
Because
this
is
not
always
needed
,
and
there
are
many
choices
available
on
how
to
index
,
declaration
of
a
foreign
key
constraint
does
not
automatically
create
an
index
on
the
referencing
columns
.
</
para
>
<
para
>
More
information
about
updating
and
deleting
data
is
in
<
xref
linkend
=
"dml"
>.
...
...
@@ -875,6 +895,11 @@ CREATE TABLE circles (
See
also
<
link
linkend
=
"SQL-CREATETABLE-EXCLUDE"
><
command
>
CREATE
TABLE
...
CONSTRAINT
...
EXCLUDE
</></
link
>
for
details
.
</
para
>
<
para
>
Adding
an
exclusion
constraint
will
automatically
create
an
index
of
the
type
specified
in
the
constraint
declaration
.
</
para
>
</
sect2
>
</
sect1
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment