One of the example queries that 'could' is identical to one that 'could not'.

Started by PG Bug reporting formover 4 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/indexes-index-only-scans.html
Description:

11.9.2 lists ```SELECT x FROM tab WHERE x = 'key' AND z < 42;``` as both
examples of 'could' and 'could not' use index-only scans. I believe this is
what was meant:
"""""""""""""""""""
but these queries could not:

SELECT x, z FROM tab WHERE x = 'key';
SELECT x FROM tab WHERE x = 'key' AND z < 42;
"""""""""""""""""""

should read:
"""""""""""""""""""
but these queries could not:

SELECT x, z FROM tab WHERE x = 'key';
SELECT z FROM tab WHERE x = 'key' AND z < 42;
"""""""""""""""""""

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: One of the example queries that 'could' is identical to one that 'could not'.

PG Doc comments form <noreply@postgresql.org> writes:

11.9.2 lists ```SELECT x FROM tab WHERE x = 'key' AND z < 42;``` as both
examples of 'could' and 'could not' use index-only scans.

No, look again: one of the queries uses the indexed column y,
and the other uses the non-indexed column z.

regards, tom lane