Re: Index only scans for expressional indices when querying for the expression - Mailing list pgsql-general

From Danny Shemesh
Subject Re: Index only scans for expressional indices when querying for the expression
Date
Msg-id CAFZC=Qo-4c8o4bg9qzCUf65wZucKkjP+ZEJa2R05G__f_Ht8cQ@mail.gmail.com
Whole thread Raw
In response to Re: Index only scans for expressional indices when querying for the expression  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Index only scans for expressional indices when querying for the expression
List pgsql-general
Hey David - thanks for the prompt response !

That is of course correct, but what I mean is that, I think that if one would explicitly query f(x), and never for x directly, it would've been
theoretically possible to say that the index is covering for every f(x), wouldn't it ?

Or in other words, if one only ever queries f(x), and the only available index is on f(x), then the index will hold all f(x) values
and would never need to reverse engineer the value of x to answer such a specific query.

Danny

On Thu, Aug 4, 2022 at 3:28 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Thursday, August 4, 2022, Danny Shemesh <dany74q@gmail.com> wrote:
I believe the expressional index in itself could've been considered as covering, when querying for the expression explicitly.

This belief is wrong.  When storing f(x) there is no way to recover the value of x.

David J.
 

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Index only scans for expressional indices when querying for the expression
Next
From: Aleš Zelený
Date:
Subject: Re: PostgreSQL 14.4 ERROR: out of memory issues