Re: Can relational alegbra perform bulk operations?

From: Banana <>
Date: Thu, 01 Oct 2009 09:31:59 -0700
Message-ID: <>

Walter Mitty wrote:
> I'm not following this. A good optimizer does one job, and lets the
> database designer/developer focus on a different job.
> If "good behavior" is simple yet sound design in both database definitions
> and database transactions, then I would claim that a good optimizer does not
> discourage good behavior as much as a bad optimizer does.

Well, think about it. If the optimizer was flawed in such way that one had to put tables in a certain order in the FROM clause or use hints, then this encourages bad behavior because now the developers have to fiddle with the optimizer, something they shouldn't be doing all the along. A optimizer that was good would have made those behavior irrelevant.

Of course, the real culprit would be the vendors because they deigned to implement in more or less ad hoc manners; no vendors are 100% SQL standard compliant and SQL standard itself was suspect to start with. Instead of addressing those more major flaws they chose to implicitly encourage more bad behavior by providing hints or attempt to expand the optimizer's scope, a job made much more harder due to nulls, duplicates among other things.

To provide an simple illustration of how good implementation can promote good behavior, consider whitespace in programming languages. It's a common convention that one indents code blocks to make it readable. In most languages, whitespace have no semantic significance so they were free to indent or not indent. There are indeed conventions over how one should indent the code but there will be codes here and there that may not indent consistently. Python changed this by making the whitespace semantically significant and thus requires indenting for a given block. Thus it made the indent and consequently the code layout far more consistent without requiring any thought from those who write code. This works far much better than developing an IDE that auto-indent code for people. Providing hints is just like providing auto-indents; it may help fix the symptoms but not the underlying problem. Received on Thu Oct 01 2009 - 18:31:59 CEST

Original text of this message