Re: [HACKERS] Re: Jesus, what have I done (was: LONG)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jan Wieck <wieck(at)debis(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: Jesus, what have I done (was: LONG)
Date: 1999-12-12 14:42:50
Message-ID: 199912121442.JAA03874@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > I am confused here. With my code, you only have to:
> >
> > add code to write/read from long tables
> > add code to expand long values in varlen access routines
> > add code to heap_insert() to move data to long tables
> > add code to heap_delete() to invalidate long tuples
>
> Add code to expand long values in varlen access routines,
> you're joking - no?

No, I am not joking. Why not expand them there? If we look at textout,
it returns a character string for the text field. Why not do the lookup
of long there and return a very long value?

If we look at texteq, we expand any long values into a palloc'ed area
and do the compare. Here, I can see the advantage of knowing the length
of the long string.

>
> How many functions are there, called via the fmgr with a
> Datum as argument, and only knowing by themself (and a system
> catalog) that they receive a variable length attribute?
>
> So you would better do the fetching in the fmgr. Then again,
> there are many places in the code (and possibly in user
> extensions too), that call builtin functions like textout()
> directly, passing it the Datum they got from somewhere.

I see what you are suggesting, that we expand in fmgr, but we don't know
the arg types in there, do we? I was suggesting we create an
expand_long() function that takes a long varlena and returns the long
value in palloc'ed memory, and sprinkle the calls in varlena.c and
varchar.c, etc.

If you prefer to expand the tuple itself, you can do that, but I think
doing it only when needed is easier because of in-buffer tuples that you
have to process without modification.

>
> I can understand why you would like to automatically pull out
> varsize values as needed. But I see really a bunch of
> problems coming with it.

These are the only comments you have? Does that mean the other things I
said are OK, or that you are humoring me?

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-12-12 14:56:16 Re: [HACKERS] Re: Jesus, what have I done (was: LONG)
Previous Message Vadim Mikheev 1999-12-12 12:22:09 Re: [HACKERS] 6.6 release