Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f248e11

Browse files
committed
Fix incorrect example in CREATE INDEX reference page, per Josh Kupershmidt.
Also fix and uncomment an old example of creating a GIST index, and make a couple of other minor editorial adjustments.
1 parent 0131088 commit f248e11

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

doc/src/sgml/ref/create_index.sgml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_index.sgml,v 1.72 2009/12/23 17:41:43 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_index.sgml,v 1.73 2010/03/17 15:55:50 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -266,10 +266,10 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable class="parameter">name</
266266
<title id="SQL-CREATEINDEX-storage-parameters-title">Index Storage Parameters</title>
267267

268268
<para>
269-
The <literal>WITH</> clause can specify <firstterm>storage parameters</>
270-
for indexes. Each index method can have its own set of allowed storage
271-
parameters. The <literal>B-tree</literal>, <literal>hash</literal> and
272-
<literal>GiST</literal> built-in index methods all accept a single parameter:
269+
The optional <literal>WITH</> clause specifies <firstterm>storage
270+
parameters</> for the index. Each index method has its own set of allowed
271+
storage parameters. The B-tree, hash and GiST index methods all accept a
272+
single parameter:
273273
</para>
274274

275275
<variablelist>
@@ -281,10 +281,11 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable class="parameter">name</
281281
The fillfactor for an index is a percentage that determines how full
282282
the index method will try to pack index pages. For B-trees, leaf pages
283283
are filled to this percentage during initial index build, and also
284-
when extending the index at the right (largest key values). If pages
284+
when extending the index at the right (adding new largest key values).
285+
If pages
285286
subsequently become completely full, they will be split, leading to
286287
gradual degradation in the index's efficiency. B-trees use a default
287-
fillfactor of 90, but any value from 10 to 100 can be selected.
288+
fillfactor of 90, but any integer value from 10 to 100 can be selected.
288289
If the table is static then fillfactor 100 is best to minimize the
289290
index's physical size, but for heavily updated tables a smaller
290291
fillfactor is better to minimize the need for page splits. The
@@ -297,7 +298,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable class="parameter">name</
297298
</variablelist>
298299

299300
<para>
300-
<literal>GIN</literal> indexes accept a different parameter:
301+
GIN indexes accept a different parameter:
301302
</para>
302303

303304
<variablelist>
@@ -373,7 +374,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable class="parameter">name</
373374
command will fail but leave behind an <quote>invalid</> index. This index
374375
will be ignored for querying purposes because it might be incomplete;
375376
however it will still consume update overhead. The <application>psql</>
376-
<command>\d</> command will mark such an index as <literal>INVALID</>:
377+
<command>\d</> command will report such an index as <literal>INVALID</>:
377378

378379
<programlisting>
379380
postgres=# \d tab
@@ -457,8 +458,8 @@ Indexes:
457458
<para>
458459
For index methods that support ordered scans (currently, only B-tree),
459460
the optional clauses <literal>ASC</>, <literal>DESC</>, <literal>NULLS
460-
FIRST</>, and/or <literal>NULLS LAST</> can be specified to reverse
461-
the normal sort direction of the index. Since an ordered index can be
461+
FIRST</>, and/or <literal>NULLS LAST</> can be specified to modify
462+
the sort ordering of the index. Since an ordered index can be
462463
scanned either forward or backward, it is not normally useful to create a
463464
single-column <literal>DESC</> index &mdash; that sort ordering is already
464465
available with a regular index. The value of these options is that
@@ -539,7 +540,7 @@ CREATE UNIQUE INDEX title_idx ON films (title) WITH (fillfactor = 70);
539540
<para>
540541
To create a <acronym>GIN</> index with fast updates disabled:
541542
<programlisting>
542-
CREATE INDEX gin_idx ON documents_table (locations) WITH (fastupdate = off);
543+
CREATE INDEX gin_idx ON documents_table USING gin (locations) WITH (fastupdate = off);
543544
</programlisting>
544545
</para>
545546

@@ -552,22 +553,17 @@ CREATE INDEX code_idx ON films (code) TABLESPACE indexspace;
552553
</programlisting>
553554
</para>
554555

555-
<!--
556-
<comment>
557-
Is this example correct?
558-
</comment>
559556
<para>
560557
To create a GiST index on a point attribute so that we
561558
can efficiently use box operators on the result of the
562559
conversion function:
563560
<programlisting>
564561
CREATE INDEX pointloc
565-
ON points USING GIST (point2box(location) box_ops);
562+
ON points USING gist (box(location,location));
566563
SELECT * FROM points
567-
WHERE point2box(points.pointloc) = boxes.box;
564+
WHERE box(location,location) &amp;&amp; '(0,0),(1,1)'::box;
568565
</programlisting>
569566
</para>
570-
-->
571567

572568
<para>
573569
To create an index without locking out writes to the table:

0 commit comments

Comments
 (0)