Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Teach SELECT DISTINCT first!

Re: Teach SELECT DISTINCT first!

From: Paul <paul_at_test.com>
Date: Wed, 28 Apr 2004 00:48:32 +0100
Message-ID: <_mCjc.36950$Y%6.5035445@wards.force9.net>


Mikito Harakiri wrote:

>> OK here's a pathological example: Define a function f on the 
>> integers by: f(i) = i  (if Fermat's Last Theorem is true
 >>                   = 0  (if Fermat's Last Theorem is false

>
> This is not closed-form expression. Normally you supply a formula
> with arithmetic operations and elementary functions.

I'm sure you could expand it out in terms of arithmetic operations and elementary functions. It might be very long though...

> CAS have their own problems even within practical realm of
> closed-form expressions, there is no need to go as far as FLT. The
> idea is however, that in vast majority of the cases CAS does an
> excellent work.

OK so say for example I do "SELECT i from R WHERE i*i < 0" where i is an integer column, then the DBMS engine should know that the square of an integer is never less than zero?

>> Now functions are actually special cases of (mathematical) 
>> relations. So maybe a relational system could think of them in this
>>  way and access them as logical (DBMS) relations. Whether they are
>>  physically implemented as an actual table or not would be up to
>> the optimizer. For example say you define a complicated function on
>>  the integers. It might be best for the DBMS to store a table that
>>  pre-calculates this.

>
> But in most cases the relation is infinite. This is why CAS
> represents a function as an expression tree. Finite representations
> of infinite objects, that is what CAS is all about.

Maybe the DBMS could store statistics about what actual ranges are used for a function in practice and physically store them which would help in 99% of cases?

>> For non-integer domains you might have more problems though. But 
>> then you've already got problems with rounding etc. where two 
>> decimals may be different theoretically but the same according to 
>> the DBMS.

>
> What is the excuse for RDBMS having fixed-point arithmetics? All CAS
> implemented unlimited precision arithmetics from the very beginning.
> Business users don't need anything that sophisticated? That is really
> lame.

Yes, I guess the problem is it's very complicated to write just a plain DBMS, let alone one with fancy optimizations, unlimited precision and computer algebra systems etc. built in.

Paul. Received on Tue Apr 27 2004 - 18:48:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US