Re: [HACKERS] binding table

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: dg(at)illustra(dot)com (David Gould)
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] binding table
Date: 1998-06-28 01:58:29
Message-ID: 199806280158.VAA05333@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I kinda wish you hadn't. These kinds of style changes impose a certain cost
> in terms of merge issues and add a (perhaps small) bit of risk of introducing
> bugs without any improvement in the product that can be detected by the
> user.

I normally would not start changing things like this, and take a 'if it
ain't broke, don't fix it' metality, but the original code was so
riddled with problems and needed changes, I got used to making massive
changes. pgindent is a great example. Very risky initially, it was
absolutely necessary to make things easier for new people looking at the
code. Now that I have become experienced making such changes, I have
not hesitated to make them. If someone is working in a certain area, I
tend to stay away, though.

I have developed a certain confidence in making these changes, partially
because mkid allows such easy identification of the problem areas. (See
developers FAQ for mkid.) For example, the /parser directory was a
terrible mess. I had worked on it, and still could not keep the stuff
straight. I redesigned the entire file layout, grouping functions into
smaller files. It was risky, and a massive diff, but I am certain it
has allowed Thomas and others to more clearly understand and change the
existing code.

Basically, I would like to continue cleaning up the code where I see
areas of improvement, as long as it does not introduce problems for
other developers.

> Btw, the name "BindingTable" is derived from the lisp terminology where
> a variable is composed of a storage location and a "binding" of a symbol to
> refer to that location. As much of postgres was initially written in lisp,
> this is a fairly natural name.
>
> As it happens, the shared memory structure (formerly) known as BindingTable
> really is used in a way that closely resembles lisp style bindings. When
> you want to create something in shared memory (eg the lock table), you
> allocate a name in the binding table and then hang all the datastructures
> onto the name.

The confusion I had is that Binding is really what a hash structure
does, allowing you to supply a value, and get a matching value. So a
BindingTable seemed like a normal hash structure, not a real shared
memory index.

I don't know lisp, so I did not know it actually had a meaning.
Unfortunately, very few other developers know lisp, so the name had
little meaning for them either.

>
> Finally, I think the name ShmemIndex lends itself to confusion with table
> indexes etc...

I can change the name again. What should it be? (Please don't say
"BindingTable"). :-)

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-06-28 02:14:10 Re: [HACKERS] I thought we had fixed this for v6.3.2 ...?
Previous Message The Hermit Hacker 1998-06-27 23:19:32 Re: [HACKERS] lwn.net