Re: Clarity in partial index example.

From: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
To: droptablestar(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org, PG Doc comments form <noreply(at)postgresql(dot)org>
Subject: Re: Clarity in partial index example.
Date: 2019-04-03 22:00:18
Message-ID: fbcb4420-881c-c1b3-4ef3-02ca38e29069@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On 4/3/19 4:20 PM, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/11/indexes-partial.html
> Description:
>
> The example illustrating when a partial index can and cannot be used is a
> little misleading. The query which can use the partial index is:
> SELECT *
> FROM access_log
> WHERE url = '/index.html' AND client_ip = inet '212.78.10.32';
>
> and the query which can't use the partial index is:
> SELECT *
> FROM access_log
> WHERE client_ip = inet '192.168.100.23';
>
> Maybe I am misunderstanding the concept here but url = '/index.html' doesn't
> have any effect on this? If that's the case I would suggest either removing
> it from the first query or adding it to the second query.

You're correct, the url = '/index.html' does not affect if the partial
index is used in the example.

Based on how the example is set up, I'd propose using the "url"
parameter in both examples. I've attached a patch that does this, with
some additional wording around the examples.

Thanks,

Jonathan

Attachment Content-Type Size
0001-Use-consistent-examples-of-queries-demonstrating-whe.patch text/plain 1.1 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2019-04-03 22:30:52 Re: Clarity in partial index example.
Previous Message PG Doc comments form 2019-04-03 20:20:08 Clarity in partial index example.