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

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Re: Jesus, what have I done (was: LONG)
Дата
Msg-id 199912121442.JAA03874@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Jesus, what have I done (was: LONG)  (wieck@debis.com (Jan Wieck))
Список 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@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Re: Jesus, what have I done (was: LONG)
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] 6.6 release