Re: Datum values consistency within one query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul Ramsey <pramsey(at)cleverelephant(dot)ca>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Datum values consistency within one query
Date: 2020-04-03 17:35:07
Message-ID: 26645.1585935307@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Paul Ramsey <pramsey(at)cleverelephant(dot)ca> writes:
> So, if I tested for VARATT_IS_EXTENDED(), and then for VARATT_IS_EXTERNAL_ONDISK(attr) and then did VARATT_EXTERNAL_GET_POINTER(toast_pointer, attr), I could use va_valueid + va_toastrelid as keys in the cache for things that passed that filter?

I'm pretty sure VARATT_IS_EXTERNAL_ONDISK subsumes the other, so you
don't need to check VARATT_IS_EXTENDED, but yeah.

> What about large const values that haven't been stored in a table yet? (eg, ST_Buffer(ST_MakePoint(0, 0), 100, 10000)) is there a stable key I can use for them?

Nope. If you could convert them into "expanded datums" then you
might have something ... but without any knowledge about where they
are coming from it's hard to see how to detect that a value is
the same one you dealt with before.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Roger Harkavy 2020-04-03 17:37:47 Re: Add A Glossary
Previous Message Corey Huinker 2020-04-03 17:34:17 Re: Add A Glossary