Conjunction junction

From: Laconic2 <laconic2_at_comcast.net>
Date: Sun, 31 Oct 2004 07:39:40 -0500
Message-ID: <atCdnT4bfsiJQBncRVn-vQ_at_comcast.com>



The title of this topic is from the jingle, "Conjunction junction, what's your function" on Schoolhouse Rock.

In another topic, Dan pointed me to Conjunctive Normal Form and Disjunctive Normal Form. Thanks Dan. The first things I got from Google were good definitions from a mathematical encyclopedia.

It might be interesting to start from CNF or DNF and work your way backwards, adding syntactic sugar, until you get a query language that the ordinary person can grok, but that doesn't lack precise formal meaning. I'll bet some of the inventors of query languages have done just that.

I note that you can define set INTERSECTION in terms of AND, set UNION in terms of OR. What is the name of the thing you can define in terms of NOT?

 Basically, the intersection of the mountain and NOT the mountain is nothing (unless you count the boundary between the mountain and NOT the mountain). The union of the mountain and NOT the mountain is all there is (the universe). Hmm....

But what I want to get to is this: why do DB designers have more trouble with disjunction than with conjunction?
Or to put it another way: why do they have more problems with generalization-specialization hierarchies than they do with intersection of sets and equijoins? To put it yet another way, why does OR bother database designers more than AND?

And it's not just database designers that get stumped by OR. Try this sometime on a sizeable test database: come up with two predicates for a where clause that are reasonably complex, yet within the range of something someone might actually use in a query. Benchmark the two queries.

Now benchmark the query you get by taking the AND of the two predicates. Then benchmark the query you get by taking the OR of the two predicates. What do you observe? Received on Sun Oct 31 2004 - 13:39:40 CET

Original text of this message