1
1
<!--
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 $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -266,10 +266,10 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable class="parameter">name</
266
266
<title id="SQL-CREATEINDEX-storage-parameters-title">Index Storage Parameters</title>
267
267
268
268
<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:
273
273
</para>
274
274
275
275
<variablelist>
@@ -281,10 +281,11 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable class="parameter">name</
281
281
The fillfactor for an index is a percentage that determines how full
282
282
the index method will try to pack index pages. For B-trees, leaf pages
283
283
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
285
286
subsequently become completely full, they will be split, leading to
286
287
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.
288
289
If the table is static then fillfactor 100 is best to minimize the
289
290
index's physical size, but for heavily updated tables a smaller
290
291
fillfactor is better to minimize the need for page splits. The
@@ -297,7 +298,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable class="parameter">name</
297
298
</variablelist>
298
299
299
300
<para>
300
- <literal> GIN</literal> indexes accept a different parameter:
301
+ GIN indexes accept a different parameter:
301
302
</para>
302
303
303
304
<variablelist>
@@ -373,7 +374,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ <replaceable class="parameter">name</
373
374
command will fail but leave behind an <quote>invalid</> index. This index
374
375
will be ignored for querying purposes because it might be incomplete;
375
376
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</>:
377
378
378
379
<programlisting>
379
380
postgres=# \d tab
@@ -457,8 +458,8 @@ Indexes:
457
458
<para>
458
459
For index methods that support ordered scans (currently, only B-tree),
459
460
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
462
463
scanned either forward or backward, it is not normally useful to create a
463
464
single-column <literal>DESC</> index — that sort ordering is already
464
465
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);
539
540
<para>
540
541
To create a <acronym>GIN</> index with fast updates disabled:
541
542
<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);
543
544
</programlisting>
544
545
</para>
545
546
@@ -552,22 +553,17 @@ CREATE INDEX code_idx ON films (code) TABLESPACE indexspace;
552
553
</programlisting>
553
554
</para>
554
555
555
- <!--
556
- <comment>
557
- Is this example correct?
558
- </comment>
559
556
<para>
560
557
To create a GiST index on a point attribute so that we
561
558
can efficiently use box operators on the result of the
562
559
conversion function:
563
560
<programlisting>
564
561
CREATE INDEX pointloc
565
- ON points USING GIST (point2box (location) box_ops );
562
+ ON points USING gist (box (location,location) );
566
563
SELECT * FROM points
567
- WHERE point2box(points.pointloc) = boxes. box;
564
+ WHERE box(location,location) && '(0,0),(1,1)':: box;
568
565
</programlisting>
569
566
</para>
570
- -->
571
567
572
568
<para>
573
569
To create an index without locking out writes to the table:
0 commit comments