pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
TOAST : partial detoasting : only a small part of a toasted value (for pgpointcloud)
3+ messages / 2 participants
[nested] [flat]

* TOAST : partial detoasting : only a small part of a toasted value (for pgpointcloud)
@ 2018-11-13 23:53  Rémi Cura <remi.cura@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Rémi Cura @ 2018-11-13 23:53 UTC (permalink / raw)
  To: pgsql-general

Hi dear list,
I have a tricky question about TOASTED memory in Postgres related to the
[pgpointcloud](https://github.com/pgpointcloud/pointcloud) extension.
(using Postgres 11 if it matters)

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).

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: TOAST : partial detoasting : only a small part of a toasted value (for pgpointcloud)
@ 2018-11-14 00:00  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Rémi Cura <remi.cura@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2018-11-14 00:00 UTC (permalink / raw)
  To: Rémi Cura <remi.cura@gmail.com>; +Cc: pgsql-general

=?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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: TOAST : partial detoasting : only a small part of a toasted value (for pgpointcloud)
@ 2018-11-14 18:47  Rémi Cura <remi.cura@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Rémi Cura @ 2018-11-14 18:47 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general

wow,
it was right under my nose.
Thank you very much !
Cheers,
Remi-C

Le mar. 13 nov. 2018 à 19:00, Tom Lane <tgl@sss.pgh.pa.us> a écrit :

> =?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
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-11-14 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13 23:53 TOAST : partial detoasting : only a small part of a toasted value (for pgpointcloud) Rémi Cura <remi.cura@gmail.com>
2018-11-14 00:00 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-11-14 18:47   ` Rémi Cura <remi.cura@gmail.com>

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