Re: [HACKERS] Number of index fields configurable

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Number of index fields configurable
Date: 2000-01-10 15:59:46
Message-ID: 200001101559.KAA14020@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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(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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-01-10 16:02:26 Re: [HACKERS] Number of index fields configurable
Previous Message Tom Lane 2000-01-10 15:54:31 Re: [HACKERS] Number of index fields configurable