Re: Is mysql a RDBMS ?

From: Heikki Tuuri <Heikki.Tuuri_at_innodb.com>
Date: Tue, 26 Aug 2003 08:31:21 GMT
Message-ID: <tVE2b.88$4X.37_at_read3.inet.fi>


Bob,

"Bob Badour" <bbadour_at_golden.net> kirjoitti viestissä news:5Az2b.699$gN.82067528_at_mantis.golden.net...
> "Heikki Tuuri" <Heikki.Tuuri_at_innodb.com> wrote in message
> news:Rpx2b.4189$G37.2895_at_read3.inet.fi...
...
> > > Just off the top of my head, I can think of the following identities
> that
> > > improve performance for relations but not necessarily for multisets:
> > >
> > > COUNT(A UNION B) = COUNT(A) + COUNT(B) - COUNT(A JOIN B)
> > >
> > > A WHERE EXISTS ( B WHERE P(A,B) AND Q(B) )
> > > = ( A JOIN ( B' WHERE P(A,B') AND Q(B') )) PROJECT { ATTRIB(A) }
> > > (B' indicates the dbms may have to rename some attributes of B)
> > >
> > > ( A(w,u) JOIN B(w,v) ) PROJECT { w }
> > > = ( A(w,u) PROJECT { w } ) JOIN ( B(w,v) PROJECT { w } )
> > >
> > > ( A UNION A ) = A
> > >
> > > ( A JOIN A ) = A
> > >
> > > ( A INTERSECT A ) = A
...
> Replacing a union with an intersection can dramatically improve
performance
> if the dbms can perform an index merge.

what rule is that? Are you referring to the COUNT() rule above? But, for multisets,

COUNT(A UNION ALL B) = COUNT(A) + COUNT(B); That rule is not available if duplicates are not allowed.

> > The example is not a real-world query.
>
> What's not real about it? The fact that it is a self-join? That happens
all

The fact that it is not from some real application.

> the time--especially when joining two views that each join the same base
> table. Or the fact that it has duplicate rows? I think duplicates are a
dumb
> idea in the first place; you are the one arguing for their use.

>

> SQL must either perform work to generate 9 rows from 3 rows or it must
> perform work to generate 1 row from 3 rows. A relational dbms does not
have
> to do any of this work. Duplicates impede optimization.

Can you show a real-world query where this is true? Or give us a reference of a refereed paper showing this? A weakness of 'mathematical-relationists' is that they fail to provide hard evidence for the claim. Refereed academic journals usually do not accept papers of type: "Of course, xyz holds! Don't you see it? Anybody home?"

Best regards,

Heikki Tuuri
Innobase Oy
http://www.innodb.com
Foreign keys, transactions, and row level locking for MySQL InnoDB Hot Backup - a hot backup tool for MySQL Received on Tue Aug 26 2003 - 10:31:21 CEST

Original text of this message