Re: Index only scans for expressional indices when querying for the expression

From: Danny Shemesh <dany74q(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Index only scans for expressional indices when querying for the expression
Date: 2022-08-04 12:31:32
Message-ID: CAFZC=Qo-4c8o4bg9qzCUf65wZucKkjP+ZEJa2R05G__f_Ht8cQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)g(dot)johnston(at)gmail(dot)com>
wrote:

> On Thursday, August 4, 2022, Danny Shemesh <dany74q(at)gmail(dot)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.
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aleš Zelený 2022-08-04 12:34:10 Re: PostgreSQL 14.4 ERROR: out of memory issues
Previous Message David G. Johnston 2022-08-04 12:28:07 Re: Index only scans for expressional indices when querying for the expression