I was remembering tonight some of the strange fixes we made in the early
days of PostgreSQL. I particularly remember the LIKE optimization I did
in gram.y to allow queries that are anchored to the beginning of a
string to use an index.
It was a crazy patch, and everyone who saw it grumbled. The problem was
that no one could think of a better solution. Finally the proper fix
was made to the optimizer and the code removed. I was glad to see it
go, if only so I didn't have to hear complaints about it. :-)
The good thing about the patch is that it gave us a feature for two
years while we gained experience to make the right fix, and it was easy
to remove once the time came.
I am now wondering if we are agonizing too much about changes to
PostgreSQL. We are much more successful, and much more reliable than we
used to be, but I wonder whether we are limiting improvements because
they are not the _right_ fix.
I am not advocating that we start throwing all sorts of stuff into the
backend. This certainly would leave us with a big mess. I am just
noticing that we are hitting road blocks where we can't find the perfect
solution, so we do nothing, even when users are complaining they need a
certain feature. I think we can all remember recent discussions or TODO
items where this happened.
Seem like it would be a good idea sometimes add feature, even an
imperfect one, until we can make a better fix, because sometimes, the
perfect fix is years away. I never expected my gram.y hack to last as
long as it did.
Let me make a suggestion. Next time we have a partial fix for
something, but don't want to add it, let's add the item on the TODO list
under the heading "Imperfect Fixes," where we list items we have fixed
but need more work. This way, we will be able to give users a feature,
but we will not forget to revisit the item and make a _perfect_ fix
later.
-- Bruce Momjian | http://candle.pha.pa.us pgman@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