pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rémi Cura <remi.cura@gmail.com>
Cc: PostgreSQL General <pgsql-general@postgresql.org>
Subject: Re: TOAST : partial detoasting : only a small part of a toasted value (for pgpointcloud)
Date: Tue, 13 Nov 2018 19:00:16 -0500
Message-ID: <27283.1542153616@sss.pgh.pa.us> (raw)
In-Reply-To: <CAJvUf_suVAfzV_XB2oCoLPFUQ9mFxDYuZGLMLn_bBD1Sdp75zw@mail.gmail.com>
References: <CAJvUf_suVAfzV_XB2oCoLPFUQ9mFxDYuZGLMLn_bBD1Sdp75zw@mail.gmail.com>

=?UTF-8?Q?R=C3=A9mi_Cura?= <remi.cura@gmail.com> writes:
> So the pgpointcloud store sometimes very large groups of points into one
> row (TOASTED), something along few kB to few MB. TOAST would be in EXTERNAL
> mode (no compression).
> Sometimes we only want to access a part of this data (one or several blocks
> within the full data).
>> From what I  understand, for the moment it requires to fetch all the data
> from disk, then de-toast it, then select only the part of the data we are
> interested in.

> Yet I think it is possible to detoast only a subset of the data (and thus
> fetch only some part of the data), considering that the [doc on toast](
> https://www.postgresql.org/docs/11/storage-toast.html) says
>> " Use of EXTERNAL will make substring operations on wide text and bytea
> columns faster
>> (at the penalty of increased storage space) because these operations are
> optimized
>> to fetch only the required parts of the out-of-line value when it is not
> compressed. "

> So my question is how does it work, how easy would it be to implement for
> pgpointcloud?

See PG_DETOAST_DATUM_SLICE and users of that macro.

			regards, tom lane




view thread (3+ messages)  latest in thread

Message-ID: <27283.1542153616@sss.pgh.pa.us>
Permalink:  ../27283.1542153616@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27283.1542153616@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, remi.cura@gmail.com
  Subject: Re: TOAST : partial detoasting : only a small part of a toasted value (for pgpointcloud)
  In-Reply-To: <27283.1542153616@sss.pgh.pa.us>
  References: <CAJvUf_suVAfzV_XB2oCoLPFUQ9mFxDYuZGLMLn_bBD1Sdp75zw@mail.gmail.com> <27283.1542153616@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox