diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2019-04-03 18:28:18 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2019-04-03 18:28:26 -0400 |
commit | af052daec5aa282eab2d22fa3b24d6109a30c2f3 (patch) | |
tree | 5a6b902895e655eff43e189f068e41dce34042ca | |
parent | ea569d64ac7174d3fe657e3e682d11053ecf1866 (diff) | |
download | postgresql-af052daec5aa282eab2d22fa3b24d6109a30c2f3.tar.gz postgresql-af052daec5aa282eab2d22fa3b24d6109a30c2f3.zip |
Doc: clarify partial-index example.
Jonathan Katz
Discussion: https://postgr.es/m/155432280882.722.12392985690846288230@wrigleys.postgresql.org
-rw-r--r-- | doc/src/sgml/indices.sgml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/src/sgml/indices.sgml b/doc/src/sgml/indices.sgml index 3493f482b86..95c0a1926c5 100644 --- a/doc/src/sgml/indices.sgml +++ b/doc/src/sgml/indices.sgml @@ -814,18 +814,20 @@ SELECT * FROM access_log WHERE url = '/index.html' AND client_ip = inet '212.78.10.32'; </programlisting> - A query that cannot use this index is: + Here the query's IP address is covered by the partial index. The + following query cannot use the partial index, as it uses an IP address + that is excluded from the index: <programlisting> SELECT * FROM access_log -WHERE client_ip = inet '192.168.100.23'; +WHERE url = '/index.html' AND client_ip = inet '192.168.100.23'; </programlisting> </para> <para> Observe that this kind of partial index requires that the common values be predetermined, so such partial indexes are best used for - data distributions that do not change. The indexes can be recreated + data distributions that do not change. Such indexes can be recreated occasionally to adjust for new data distributions, but this adds maintenance effort. </para> |