Skip to content

Commit af052da

Browse files
committed
Doc: clarify partial-index example.
Jonathan Katz Discussion: https://postgr.es/m/155432280882.722.12392985690846288230@wrigleys.postgresql.org
1 parent ea569d6 commit af052da

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/src/sgml/indices.sgml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -814,18 +814,20 @@ SELECT *
814814
FROM access_log
815815
WHERE url = '/index.html' AND client_ip = inet '212.78.10.32';
816816
</programlisting>
817-
A query that cannot use this index is:
817+
Here the query's IP address is covered by the partial index. The
818+
following query cannot use the partial index, as it uses an IP address
819+
that is excluded from the index:
818820
<programlisting>
819821
SELECT *
820822
FROM access_log
821-
WHERE client_ip = inet '192.168.100.23';
823+
WHERE url = '/index.html' AND client_ip = inet '192.168.100.23';
822824
</programlisting>
823825
</para>
824826

825827
<para>
826828
Observe that this kind of partial index requires that the common
827829
values be predetermined, so such partial indexes are best used for
828-
data distributions that do not change. The indexes can be recreated
830+
data distributions that do not change. Such indexes can be recreated
829831
occasionally to adjust for new data distributions, but this adds
830832
maintenance effort.
831833
</para>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy