Re: SQL



On 7 Feb 2006 18:04:08 -0800, topmind wrote:

Dmitry A. Kazakov wrote:
On 6 Feb 2006 19:32:11 -0800, topmind wrote:

Dmitry A. Kazakov wrote:

Huh, the code you presented is 1) longer, 2) far more confused.

I don't have to define and hunt down definitions of types. You will
have something like:

a = new integer(min=-223452345, max=234234234);
b = new integer(min=-09809809809, max=242093423423);
x = a.add(b);

type I is new Integer; -- Compare with CREATE TABLE statement
A, B, X : Integer;
X := A + B;

The context was "configurable" integers. You are using the
out-of-the-box 8-byte version here, not configurable ones.

Replace the first line with:

type I is range -223452345..234234234;

Now show me a relational equivalent! You need a table of types. In that
table you need columns for minimal and maximal values, set to NULL when not
applicable. You need a column describing the class of the type [numberic,
string etc] and the operations defined on it. A type will be created by an
INSERT statement etc. Cool! (:-))

Rounding errors for "add"?

Add 1.0 to 1000000000.0 in IEEE 32-bit and print the result. That should be
the very first thing students should do in classes. This is why different
numeric models exist. There is a trade-off space, performance, accuracy,
set of closed operations. It isn't rocket science...

Floating point tends to stink for biz apps,

Rubbish. What stinks is lack of understanding differences between numeric
models and missing contracts specifying the *semantics* of numeric
operations.

where decimal arithmetic is
preferred over converted binary. But, that is another topic. (Although
I've nevered encountered floating point problems during adds IIRC.)

Calculate an average of a column containing pair millions numbers like 1.0
and 1000000000.0. Then ask yourself how accurate the result is.

Why are you selecting "science lab" kinds of problems anyhow?

1. There is no such division. When a customer comes to us, he asks for a
complete solution of his problem. That includes data acquisition, data
archiving, human-machine interface, and a bit of "science lab."

2. It is a paradigm in question. A paradigm should be capable to decompose
any problem.

Can I copy it? Is the
copy unique again? In which scope? Can I add such keys? Sort them? These
questions have many contradicting answers. Sometimes I need one answer,
sometimes other. ADT solves that by having clear contracts of the objects
in use.

Show me! OO has a horrible time with usable identity, with no built-in
referential tools whatsoever, leading to "creative" solutions.

OO gives you an opportunity to analyse the problem. It does not warranty,
that you'll find a solution. The point I'm trying to make that you cannot
freeze types, it must be an open-end types system. Your position is that
openness stops with data. This is too limiting.

This is a *good* restriction of the relational model. Hard-nesting is
hard-wiring a particular viewpoint or (access path) into the model,
which goes against the relativistic philosophy of relational. Dr. Codd
set out to purposely avoid hard-wired access paths when he started
thinking about relational due to the navigational messes that others
were creating. However, it does not limit what can be modelled
externaly. One can still model nested stuff using non-nested tables.

It is not a technical "limit", but a philosophical guide-wall.

Yes. It means that your model isn't complete.

"Complete" for what?

For efficient software reuse.

Note also relations, as found
in mathematics, do not impose any such limitations. I can have a set of
sets, a set of set of sets, etc and define relations on them.

So? You can also nest a mess inside a mess inside a mess inside a mess.
However, please keep it out of our world.

Then, please, don't argue to the authority of mathematics. It isn't on your
side.

Relational imposes rules to be called "relational". Otherwise, it would
turn into the navigational messes that motivated the creation of
relational to begin with.

So data in RDBs cannot be properly structured. Fortunately there still
exist hierarchical DBs!

"Properly"? As defined by what?

By the application domain. Relational approach forces quite artificial
constructions.

No, we wish to model them as relations! Polygon isn't a relation. You can
have a table of rows representing polygons, that's OK. Now, write the
SELECT statement that gives me the car position, movement direction and
distance to the next turn I have to do. Show, how this problem can be
decomposed using relational approach.

Use the distance formula to find the nearest matches. The rest is left
as a reader excercise.

No that will extract the whole table and sort it by the distance! Many
thanks!

And, I don't know where you are getting your size estimates.

From GPS resolution 30cm. Non-relational approach can reduce the amount of
data needed for search, use k-trees, for example. But you have to stick to
X=a Y=b, which is absolutely unrealistic.

Relational does not dictate implementation. Yes, it means you may have
to have custom programmed RDBMS engines to get the most compact
representation possible, but that will be the case no matter what you
use.

Stop here. "Custom" in "custom programmed RDBMS engine" means
non-relationally programmed. Am I right?

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.



Relevant Pages

  • Re: Anyone Seen Tom K???
    ... It's a mess, but the worst case scenario here in the US would still be ... investments, real estate, and other investments. ... corporate whores who live on bloated government contracts. ... Pick up 50% of the costs of people's mortgages, pay them for them, pay ...
    (rec.bicycles.racing)
  • Re: the speed of light and shadowing
    ... and lorentz fitzgerald contracts to the same point in ... That's the same question, as for the shadow. ... There must be a concept of distance and space even for light, ... I am going to make the contrary assumption that an atom ...
    (sci.math)
  • Re: OT -- Should have brought a gun to the knife fight
    ... progun movement than all the blustering and name calling rec.scubans ... can muster. ... Lets not forget that as you try so desperately to distance yourself from the ... mess you worked so hard to create, that once again, you seem to think you ...
    (rec.scuba)