Re: [HACKERS] Number of index fields configurable

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Number of index fields configurable
Дата
Msg-id 200001101559.KAA14020@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Number of index fields configurable  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Number of index fields configurable  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > OK, different solution.  I decided there is no need to be dumping out
> > zeros to pad the type.
> 
> Oh, that's a thought.  You haven't really gained anything in generality,
> since the code is still treating zero as a special case; but I agree it
> looks nicer (and is easier to check for too many values).
> 
> Only worry I have is whether it will interoperate comfortably with the
> old code.  Let's see:
> 
> * old dump to new: no problem, unless you've reduced MAX_INDEX_KEYS
>   below 8 (doesn't seem likely).
> 
> * new to old: fails for every case except where there's exactly 8
>   non zero entries.

Not sure about this.  Old code did sscanf on 8 entries, but if it
returned fewer, it padded with zeros, so new->old should work.

> 
> The latter is a bit bothersome, but may not be a big deal --- in reality
> we don't dump and reload pg_index this way.
> 
> BTW, be sure you are only suppressing *trailing* zeroes not *embedded*
> zeroes.  I know that oid8 has to deal with embedded zeroes (some of
> the pg_proc entries look like that); int28 might not, but the code
> should probably act the same for both.

Yes, only trailing.  New code walks from end to beginning until it finds
a non-zero.  If the entry is all zeros, you get a zero-length string
output.


--  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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Number of index fields configurable
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Number of index fields configurable