Bagless Sql

This is to explore the implications of making a "bagless" SQL, one in which each processed "row" has a well-defined primary key-set.


Possible changes to SQL:


I would suggest substituting "primary key" with "candidate key".

What would be the motivation to produce BaglessSql without fixing the other SqlFlaws?

This just explores one issue. If you want to explore other ones, be my guest.

EssentialComplexity often arises from constraints or FeatureInteraction. For example, to travel is to get from point A to point B and live through the ordeal. If you "just explore one issue" - getting from point A to point B, without the survival constraint - many of your efforts will amount to naught more than MentalMasturbation (we could fire you from a cannon, for example). If MentalMasturbation is your goal, I won't stop you, but I also will not see this page as a reasonable reference for a point in an argument.

True, FeatureInteraction is an important issue. However, one must walk before they run. Often it's useful to first explore issues in isolation and then move on to interactions.

We are already walking.

Can you name another issue that intersects with the bag issue?

Sure. SQL's order-by semantics and NULL handling are both issues that intersect with bagginess.

Wait a second, you are not suggesting we get rid of Order By, are you?

I suggest moving Order By into a separate statement, perhaps part of export. Relations, after all, are not ordered.

Query languages are as much for humans as computers. Anyhow, this will probably turn into the same kind of utility-versus-purity debate as found in the SELECT-without-key debate in HowOtherQueryLanguagesAddressSqlFlaws and BagAtational. Thus, I won't bother to repeat those arguments here other than say the removal of ordered output (or an extra step) will probably be noticed more by users than Selects requiring candidate keys and be a potential sore spot with them. -t

Moving the responsibility to a different keyword is not "removal". Nor is it an "extra step", since the total number of steps is, at worst, the same as in SQL (assuming you don't bother improving SQL's abstraction features while you're tweaking everything else). I'm certain your arguments here would be just as specious as they were in BagAtational.

So let's move on to nulls. How will nulls affect de-bagging SQL? -t

The question is of "null handling", in particular whether NULL == NULL is true, false, or something else, especially across joins. It is only a problem if NULL is allowed to show up inside a candidate key.


See DatabaseDomainsForNumbers, BagNeedScenarios


EditText of this page (last edited October 23, 2010) or FindPage with title or text search