Re: Efficient slicing/substring of TOAST values (for comment)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John Gray <jgray(at)azuli(dot)co(dot)uk>
Cc: pgsql-patches(at)postgresql(dot)org, Jan Wieck <JanWieck(at)Yahoo(dot)com>
Subject: Re: Efficient slicing/substring of TOAST values (for comment)
Date: 2001-10-11 03:54:20
Message-ID: 9125.1002772460@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

John Gray <jgray(at)azuli(dot)co(dot)uk> writes:
> I've had a look, and it seems that AlterTableAlterColumnStatistics
> contains a lot of template code (and only a small amount actually
> dealing with stats). If we had different Node types for the different
> Column flag-changing operations (especially those which don't touch
> tuple data at all) then the current AlterTableAlterColumnStatistics
> might become AlterTableAlterColumnFlags (?) and take several kinds of
> nodes. Thus all the inheritance-supporting code wouldn't need to be
> duplicated. Alternatively, cloning the routine wouldn't be too much
> work.

Sounds like a great idea --- the ALTER TABLE code has kind of grown
without supervision over the past few releases, since cut-and-paste
was the easiest starting point for implementing any new variant.
Some creative refactoring would help it out a lot. Go for it, if
you feel like doing that.

[ back to original subject ]

>> Have you got any ideas about the update side of the problem?

> What I'm not sure about is the syntax for specifying such an update.

Yup, that's the key part of the problem.

> Would we just overload the syntax for an array?

> e.g. UPDATE objects SET obj_data[32:47]='0123456789abcdef';

This makes lots of sense for bytea, which ought to be considered an
array type anyway, but I'm less certain about doing it that way for
multibyte text objects. Seems like it could be pretty inefficient
if the subscriptable entities are of varying length. Ideas anyone?

> I can see the other problem being that an updated toast value currently
> gets a new valueid.

Not sure if this is necessary or not. Jan?

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2001-10-11 06:19:39 Re: Efficient slicing/substring of TOAST values (for comment)
Previous Message Bruce Momjian 2001-10-10 19:42:01 Re: [PATCH] unconditionally enable pltcl-unknown