dbTalk Databases Forums  

Functions in the relational context

comp.databases.theory comp.databases.theory


Discuss Functions in the relational context in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tegiri Nenashi
 
Posts: n/a

Default Functions in the relational context - 03-06-2008 , 02:14 PM






Many people from both side of the fence suggested that functional
programming is a promising idea that can embrace both paradigms. Here
is why I don't think so. Consider the earlier cute exercise:

On Mar 6, 10:55 am, Tegiri Nenashi <TegiriNena... (AT) gmail (DOT) com> wrote:
Quote:
What function the following query

SELECT x FROM sine WHEN y=0.5

represent?
We have a relation Sine(x,y), which in SQL looks like this

table Sine (
x number;
y number;
)

One can go ahead and start inserting the values into it, until he
realizes that this relation is infinite, so it is better be something
else than a table. To simplify the discussion, however, I'll continue
to pretend that it is a table (that is relation with finite number of
tuples).

Now, consider the query

SELECT y FROM sine WHEN x=pi/4

Without any index on the Sine table, the execution has to scan all the
values and filter only those that satisfy the predicate. We'd better
have some index to make a quick execution:

create unique index sin on Sine(x);

With this index in place the execution is just a unique index scan,
then the retrieval of the matching tuple from the table. Likewise, if
we have

SELECT x FROM sine WHEN y=1/2

then we'd better have an index

create index arcsin on Sine(y);

Unlike the previous case it is no longer a unique.

Now does it coincidental, that I named the indexes "sin" and "arcsin",
implying that there is perhaps some similarity to the functions sin(),
and arcsin()? (The latter being multivalued function, of course). Not
at all, the only difference is in implementation:

* The index "sin" calculates the value sin(pi/4) by performing a
lookup in some structure.

* The function "sin" calculates the value sin(pi/4) by performing
arithmetic operations.

This idea IMO is a vehicle to extending relations to the infinite
case. We can't scan infinite relations in principle, but can join them
by the means of the indexes -- that is the functions.



Reply With Quote
  #2  
Old   
Yagotta B. Kidding
 
Posts: n/a

Default Re: Functions in the relational context - 03-06-2008 , 02:45 PM






Tegiri Nenashi <TegiriNenashi (AT) gmail (DOT) com> wrote in news:ffb9d7ab-99d0-
44b3-91df-be581420f6c6 (AT) s12g2000...oglegroups.com:

Quote:
Many people from both side of the fence suggested that functional
programming is a promising idea that can embrace both paradigms. Here
is why I don't think so. Consider the earlier cute exercise:

On Mar 6, 10:55 am, Tegiri Nenashi <TegiriNena... (AT) gmail (DOT) com> wrote:
What function the following query

SELECT x FROM sine WHEN y=0.5

represent?

We have a relation Sine(x,y), which in SQL looks like this

table Sine (
x number;
y number;
)

One can go ahead and start inserting the values into it, until he
realizes that this relation is infinite, so it is better be something
else than a table. To simplify the discussion, however, I'll continue
to pretend that it is a table (that is relation with finite number of
tuples).

Now, consider the query

SELECT y FROM sine WHEN x=pi/4

Without any index on the Sine table, the execution has to scan all the
values and filter only those that satisfy the predicate. We'd better
have some index to make a quick execution:

create unique index sin on Sine(x);

With this index in place the execution is just a unique index scan,
then the retrieval of the matching tuple from the table. Likewise, if
we have

SELECT x FROM sine WHEN y=1/2

then we'd better have an index

create index arcsin on Sine(y);

Unlike the previous case it is no longer a unique.

Now does it coincidental, that I named the indexes "sin" and "arcsin",
implying that there is perhaps some similarity to the functions sin(),
and arcsin()? (The latter being multivalued function, of course). Not
at all, the only difference is in implementation:

* The index "sin" calculates the value sin(pi/4) by performing a
lookup in some structure.

* The function "sin" calculates the value sin(pi/4) by performing
arithmetic operations.

This idea IMO is a vehicle to extending relations to the infinite
case. We can't scan infinite relations in principle, but can join them
by the means of the indexes -- that is the functions.


I do not see how your exercise, whilst no doubt cute, discredits the
idea that FP can be fruitfully applied to the data management field.
Care to provide the missing link/s in your logical chain, like, 'in the
RA we can do such and so, but in FP we cannot, therefore, FP is really
no good'. Besides, on its face, the exercise is not really relevant to
the RA data management. Are you talking about something like constraint
databases where you operate with formulas rather than data ?



Reply With Quote
  #3  
Old   
Yagotta B. Kidding
 
Posts: n/a

Default Re: Functions in the relational context - 03-06-2008 , 02:45 PM



Tegiri Nenashi <TegiriNenashi (AT) gmail (DOT) com> wrote in news:ffb9d7ab-99d0-
44b3-91df-be581420f6c6 (AT) s12g2000...oglegroups.com:

Quote:
Many people from both side of the fence suggested that functional
programming is a promising idea that can embrace both paradigms. Here
is why I don't think so. Consider the earlier cute exercise:

On Mar 6, 10:55 am, Tegiri Nenashi <TegiriNena... (AT) gmail (DOT) com> wrote:
What function the following query

SELECT x FROM sine WHEN y=0.5

represent?

We have a relation Sine(x,y), which in SQL looks like this

table Sine (
x number;
y number;
)

One can go ahead and start inserting the values into it, until he
realizes that this relation is infinite, so it is better be something
else than a table. To simplify the discussion, however, I'll continue
to pretend that it is a table (that is relation with finite number of
tuples).

Now, consider the query

SELECT y FROM sine WHEN x=pi/4

Without any index on the Sine table, the execution has to scan all the
values and filter only those that satisfy the predicate. We'd better
have some index to make a quick execution:

create unique index sin on Sine(x);

With this index in place the execution is just a unique index scan,
then the retrieval of the matching tuple from the table. Likewise, if
we have

SELECT x FROM sine WHEN y=1/2

then we'd better have an index

create index arcsin on Sine(y);

Unlike the previous case it is no longer a unique.

Now does it coincidental, that I named the indexes "sin" and "arcsin",
implying that there is perhaps some similarity to the functions sin(),
and arcsin()? (The latter being multivalued function, of course). Not
at all, the only difference is in implementation:

* The index "sin" calculates the value sin(pi/4) by performing a
lookup in some structure.

* The function "sin" calculates the value sin(pi/4) by performing
arithmetic operations.

This idea IMO is a vehicle to extending relations to the infinite
case. We can't scan infinite relations in principle, but can join them
by the means of the indexes -- that is the functions.


I do not see how your exercise, whilst no doubt cute, discredits the
idea that FP can be fruitfully applied to the data management field.
Care to provide the missing link/s in your logical chain, like, 'in the
RA we can do such and so, but in FP we cannot, therefore, FP is really
no good'. Besides, on its face, the exercise is not really relevant to
the RA data management. Are you talking about something like constraint
databases where you operate with formulas rather than data ?



Reply With Quote
  #4  
Old   
Yagotta B. Kidding
 
Posts: n/a

Default Re: Functions in the relational context - 03-06-2008 , 02:45 PM



Tegiri Nenashi <TegiriNenashi (AT) gmail (DOT) com> wrote in news:ffb9d7ab-99d0-
44b3-91df-be581420f6c6 (AT) s12g2000...oglegroups.com:

Quote:
Many people from both side of the fence suggested that functional
programming is a promising idea that can embrace both paradigms. Here
is why I don't think so. Consider the earlier cute exercise:

On Mar 6, 10:55 am, Tegiri Nenashi <TegiriNena... (AT) gmail (DOT) com> wrote:
What function the following query

SELECT x FROM sine WHEN y=0.5

represent?

We have a relation Sine(x,y), which in SQL looks like this

table Sine (
x number;
y number;
)

One can go ahead and start inserting the values into it, until he
realizes that this relation is infinite, so it is better be something
else than a table. To simplify the discussion, however, I'll continue
to pretend that it is a table (that is relation with finite number of
tuples).

Now, consider the query

SELECT y FROM sine WHEN x=pi/4

Without any index on the Sine table, the execution has to scan all the
values and filter only those that satisfy the predicate. We'd better
have some index to make a quick execution:

create unique index sin on Sine(x);

With this index in place the execution is just a unique index scan,
then the retrieval of the matching tuple from the table. Likewise, if
we have

SELECT x FROM sine WHEN y=1/2

then we'd better have an index

create index arcsin on Sine(y);

Unlike the previous case it is no longer a unique.

Now does it coincidental, that I named the indexes "sin" and "arcsin",
implying that there is perhaps some similarity to the functions sin(),
and arcsin()? (The latter being multivalued function, of course). Not
at all, the only difference is in implementation:

* The index "sin" calculates the value sin(pi/4) by performing a
lookup in some structure.

* The function "sin" calculates the value sin(pi/4) by performing
arithmetic operations.

This idea IMO is a vehicle to extending relations to the infinite
case. We can't scan infinite relations in principle, but can join them
by the means of the indexes -- that is the functions.


I do not see how your exercise, whilst no doubt cute, discredits the
idea that FP can be fruitfully applied to the data management field.
Care to provide the missing link/s in your logical chain, like, 'in the
RA we can do such and so, but in FP we cannot, therefore, FP is really
no good'. Besides, on its face, the exercise is not really relevant to
the RA data management. Are you talking about something like constraint
databases where you operate with formulas rather than data ?



Reply With Quote
  #5  
Old   
Yagotta B. Kidding
 
Posts: n/a

Default Re: Functions in the relational context - 03-06-2008 , 02:45 PM



Tegiri Nenashi <TegiriNenashi (AT) gmail (DOT) com> wrote in news:ffb9d7ab-99d0-
44b3-91df-be581420f6c6 (AT) s12g2000...oglegroups.com:

Quote:
Many people from both side of the fence suggested that functional
programming is a promising idea that can embrace both paradigms. Here
is why I don't think so. Consider the earlier cute exercise:

On Mar 6, 10:55 am, Tegiri Nenashi <TegiriNena... (AT) gmail (DOT) com> wrote:
What function the following query

SELECT x FROM sine WHEN y=0.5

represent?

We have a relation Sine(x,y), which in SQL looks like this

table Sine (
x number;
y number;
)

One can go ahead and start inserting the values into it, until he
realizes that this relation is infinite, so it is better be something
else than a table. To simplify the discussion, however, I'll continue
to pretend that it is a table (that is relation with finite number of
tuples).

Now, consider the query

SELECT y FROM sine WHEN x=pi/4

Without any index on the Sine table, the execution has to scan all the
values and filter only those that satisfy the predicate. We'd better
have some index to make a quick execution:

create unique index sin on Sine(x);

With this index in place the execution is just a unique index scan,
then the retrieval of the matching tuple from the table. Likewise, if
we have

SELECT x FROM sine WHEN y=1/2

then we'd better have an index

create index arcsin on Sine(y);

Unlike the previous case it is no longer a unique.

Now does it coincidental, that I named the indexes "sin" and "arcsin",
implying that there is perhaps some similarity to the functions sin(),
and arcsin()? (The latter being multivalued function, of course). Not
at all, the only difference is in implementation:

* The index "sin" calculates the value sin(pi/4) by performing a
lookup in some structure.

* The function "sin" calculates the value sin(pi/4) by performing
arithmetic operations.

This idea IMO is a vehicle to extending relations to the infinite
case. We can't scan infinite relations in principle, but can join them
by the means of the indexes -- that is the functions.


I do not see how your exercise, whilst no doubt cute, discredits the
idea that FP can be fruitfully applied to the data management field.
Care to provide the missing link/s in your logical chain, like, 'in the
RA we can do such and so, but in FP we cannot, therefore, FP is really
no good'. Besides, on its face, the exercise is not really relevant to
the RA data management. Are you talking about something like constraint
databases where you operate with formulas rather than data ?



Reply With Quote
  #6  
Old   
Yagotta B. Kidding
 
Posts: n/a

Default Re: Functions in the relational context - 03-06-2008 , 02:45 PM



Tegiri Nenashi <TegiriNenashi (AT) gmail (DOT) com> wrote in news:ffb9d7ab-99d0-
44b3-91df-be581420f6c6 (AT) s12g2000...oglegroups.com:

Quote:
Many people from both side of the fence suggested that functional
programming is a promising idea that can embrace both paradigms. Here
is why I don't think so. Consider the earlier cute exercise:

On Mar 6, 10:55 am, Tegiri Nenashi <TegiriNena... (AT) gmail (DOT) com> wrote:
What function the following query

SELECT x FROM sine WHEN y=0.5

represent?

We have a relation Sine(x,y), which in SQL looks like this

table Sine (
x number;
y number;
)

One can go ahead and start inserting the values into it, until he
realizes that this relation is infinite, so it is better be something
else than a table. To simplify the discussion, however, I'll continue
to pretend that it is a table (that is relation with finite number of
tuples).

Now, consider the query

SELECT y FROM sine WHEN x=pi/4

Without any index on the Sine table, the execution has to scan all the
values and filter only those that satisfy the predicate. We'd better
have some index to make a quick execution:

create unique index sin on Sine(x);

With this index in place the execution is just a unique index scan,
then the retrieval of the matching tuple from the table. Likewise, if
we have

SELECT x FROM sine WHEN y=1/2

then we'd better have an index

create index arcsin on Sine(y);

Unlike the previous case it is no longer a unique.

Now does it coincidental, that I named the indexes "sin" and "arcsin",
implying that there is perhaps some similarity to the functions sin(),
and arcsin()? (The latter being multivalued function, of course). Not
at all, the only difference is in implementation:

* The index "sin" calculates the value sin(pi/4) by performing a
lookup in some structure.

* The function "sin" calculates the value sin(pi/4) by performing
arithmetic operations.

This idea IMO is a vehicle to extending relations to the infinite
case. We can't scan infinite relations in principle, but can join them
by the means of the indexes -- that is the functions.


I do not see how your exercise, whilst no doubt cute, discredits the
idea that FP can be fruitfully applied to the data management field.
Care to provide the missing link/s in your logical chain, like, 'in the
RA we can do such and so, but in FP we cannot, therefore, FP is really
no good'. Besides, on its face, the exercise is not really relevant to
the RA data management. Are you talking about something like constraint
databases where you operate with formulas rather than data ?



Reply With Quote
  #7  
Old   
Yagotta B. Kidding
 
Posts: n/a

Default Re: Functions in the relational context - 03-06-2008 , 02:45 PM



Tegiri Nenashi <TegiriNenashi (AT) gmail (DOT) com> wrote in news:ffb9d7ab-99d0-
44b3-91df-be581420f6c6 (AT) s12g2000...oglegroups.com:

Quote:
Many people from both side of the fence suggested that functional
programming is a promising idea that can embrace both paradigms. Here
is why I don't think so. Consider the earlier cute exercise:

On Mar 6, 10:55 am, Tegiri Nenashi <TegiriNena... (AT) gmail (DOT) com> wrote:
What function the following query

SELECT x FROM sine WHEN y=0.5

represent?

We have a relation Sine(x,y), which in SQL looks like this

table Sine (
x number;
y number;
)

One can go ahead and start inserting the values into it, until he
realizes that this relation is infinite, so it is better be something
else than a table. To simplify the discussion, however, I'll continue
to pretend that it is a table (that is relation with finite number of
tuples).

Now, consider the query

SELECT y FROM sine WHEN x=pi/4

Without any index on the Sine table, the execution has to scan all the
values and filter only those that satisfy the predicate. We'd better
have some index to make a quick execution:

create unique index sin on Sine(x);

With this index in place the execution is just a unique index scan,
then the retrieval of the matching tuple from the table. Likewise, if
we have

SELECT x FROM sine WHEN y=1/2

then we'd better have an index

create index arcsin on Sine(y);

Unlike the previous case it is no longer a unique.

Now does it coincidental, that I named the indexes "sin" and "arcsin",
implying that there is perhaps some similarity to the functions sin(),
and arcsin()? (The latter being multivalued function, of course). Not
at all, the only difference is in implementation:

* The index "sin" calculates the value sin(pi/4) by performing a
lookup in some structure.

* The function "sin" calculates the value sin(pi/4) by performing
arithmetic operations.

This idea IMO is a vehicle to extending relations to the infinite
case. We can't scan infinite relations in principle, but can join them
by the means of the indexes -- that is the functions.


I do not see how your exercise, whilst no doubt cute, discredits the
idea that FP can be fruitfully applied to the data management field.
Care to provide the missing link/s in your logical chain, like, 'in the
RA we can do such and so, but in FP we cannot, therefore, FP is really
no good'. Besides, on its face, the exercise is not really relevant to
the RA data management. Are you talking about something like constraint
databases where you operate with formulas rather than data ?



Reply With Quote
  #8  
Old   
Yagotta B. Kidding
 
Posts: n/a

Default Re: Functions in the relational context - 03-06-2008 , 02:45 PM



Tegiri Nenashi <TegiriNenashi (AT) gmail (DOT) com> wrote in news:ffb9d7ab-99d0-
44b3-91df-be581420f6c6 (AT) s12g2000...oglegroups.com:

Quote:
Many people from both side of the fence suggested that functional
programming is a promising idea that can embrace both paradigms. Here
is why I don't think so. Consider the earlier cute exercise:

On Mar 6, 10:55 am, Tegiri Nenashi <TegiriNena... (AT) gmail (DOT) com> wrote:
What function the following query

SELECT x FROM sine WHEN y=0.5

represent?

We have a relation Sine(x,y), which in SQL looks like this

table Sine (
x number;
y number;
)

One can go ahead and start inserting the values into it, until he
realizes that this relation is infinite, so it is better be something
else than a table. To simplify the discussion, however, I'll continue
to pretend that it is a table (that is relation with finite number of
tuples).

Now, consider the query

SELECT y FROM sine WHEN x=pi/4

Without any index on the Sine table, the execution has to scan all the
values and filter only those that satisfy the predicate. We'd better
have some index to make a quick execution:

create unique index sin on Sine(x);

With this index in place the execution is just a unique index scan,
then the retrieval of the matching tuple from the table. Likewise, if
we have

SELECT x FROM sine WHEN y=1/2

then we'd better have an index

create index arcsin on Sine(y);

Unlike the previous case it is no longer a unique.

Now does it coincidental, that I named the indexes "sin" and "arcsin",
implying that there is perhaps some similarity to the functions sin(),
and arcsin()? (The latter being multivalued function, of course). Not
at all, the only difference is in implementation:

* The index "sin" calculates the value sin(pi/4) by performing a
lookup in some structure.

* The function "sin" calculates the value sin(pi/4) by performing
arithmetic operations.

This idea IMO is a vehicle to extending relations to the infinite
case. We can't scan infinite relations in principle, but can join them
by the means of the indexes -- that is the functions.


I do not see how your exercise, whilst no doubt cute, discredits the
idea that FP can be fruitfully applied to the data management field.
Care to provide the missing link/s in your logical chain, like, 'in the
RA we can do such and so, but in FP we cannot, therefore, FP is really
no good'. Besides, on its face, the exercise is not really relevant to
the RA data management. Are you talking about something like constraint
databases where you operate with formulas rather than data ?



Reply With Quote
  #9  
Old   
Yagotta B. Kidding
 
Posts: n/a

Default Re: Functions in the relational context - 03-06-2008 , 02:45 PM



Tegiri Nenashi <TegiriNenashi (AT) gmail (DOT) com> wrote in news:ffb9d7ab-99d0-
44b3-91df-be581420f6c6 (AT) s12g2000...oglegroups.com:

Quote:
Many people from both side of the fence suggested that functional
programming is a promising idea that can embrace both paradigms. Here
is why I don't think so. Consider the earlier cute exercise:

On Mar 6, 10:55 am, Tegiri Nenashi <TegiriNena... (AT) gmail (DOT) com> wrote:
What function the following query

SELECT x FROM sine WHEN y=0.5

represent?

We have a relation Sine(x,y), which in SQL looks like this

table Sine (
x number;
y number;
)

One can go ahead and start inserting the values into it, until he
realizes that this relation is infinite, so it is better be something
else than a table. To simplify the discussion, however, I'll continue
to pretend that it is a table (that is relation with finite number of
tuples).

Now, consider the query

SELECT y FROM sine WHEN x=pi/4

Without any index on the Sine table, the execution has to scan all the
values and filter only those that satisfy the predicate. We'd better
have some index to make a quick execution:

create unique index sin on Sine(x);

With this index in place the execution is just a unique index scan,
then the retrieval of the matching tuple from the table. Likewise, if
we have

SELECT x FROM sine WHEN y=1/2

then we'd better have an index

create index arcsin on Sine(y);

Unlike the previous case it is no longer a unique.

Now does it coincidental, that I named the indexes "sin" and "arcsin",
implying that there is perhaps some similarity to the functions sin(),
and arcsin()? (The latter being multivalued function, of course). Not
at all, the only difference is in implementation:

* The index "sin" calculates the value sin(pi/4) by performing a
lookup in some structure.

* The function "sin" calculates the value sin(pi/4) by performing
arithmetic operations.

This idea IMO is a vehicle to extending relations to the infinite
case. We can't scan infinite relations in principle, but can join them
by the means of the indexes -- that is the functions.


I do not see how your exercise, whilst no doubt cute, discredits the
idea that FP can be fruitfully applied to the data management field.
Care to provide the missing link/s in your logical chain, like, 'in the
RA we can do such and so, but in FP we cannot, therefore, FP is really
no good'. Besides, on its face, the exercise is not really relevant to
the RA data management. Are you talking about something like constraint
databases where you operate with formulas rather than data ?



Reply With Quote
  #10  
Old   
Yagotta B. Kidding
 
Posts: n/a

Default Re: Functions in the relational context - 03-06-2008 , 02:45 PM



Tegiri Nenashi <TegiriNenashi (AT) gmail (DOT) com> wrote in news:ffb9d7ab-99d0-
44b3-91df-be581420f6c6 (AT) s12g2000...oglegroups.com:

Quote:
Many people from both side of the fence suggested that functional
programming is a promising idea that can embrace both paradigms. Here
is why I don't think so. Consider the earlier cute exercise:

On Mar 6, 10:55 am, Tegiri Nenashi <TegiriNena... (AT) gmail (DOT) com> wrote:
What function the following query

SELECT x FROM sine WHEN y=0.5

represent?

We have a relation Sine(x,y), which in SQL looks like this

table Sine (
x number;
y number;
)

One can go ahead and start inserting the values into it, until he
realizes that this relation is infinite, so it is better be something
else than a table. To simplify the discussion, however, I'll continue
to pretend that it is a table (that is relation with finite number of
tuples).

Now, consider the query

SELECT y FROM sine WHEN x=pi/4

Without any index on the Sine table, the execution has to scan all the
values and filter only those that satisfy the predicate. We'd better
have some index to make a quick execution:

create unique index sin on Sine(x);

With this index in place the execution is just a unique index scan,
then the retrieval of the matching tuple from the table. Likewise, if
we have

SELECT x FROM sine WHEN y=1/2

then we'd better have an index

create index arcsin on Sine(y);

Unlike the previous case it is no longer a unique.

Now does it coincidental, that I named the indexes "sin" and "arcsin",
implying that there is perhaps some similarity to the functions sin(),
and arcsin()? (The latter being multivalued function, of course). Not
at all, the only difference is in implementation:

* The index "sin" calculates the value sin(pi/4) by performing a
lookup in some structure.

* The function "sin" calculates the value sin(pi/4) by performing
arithmetic operations.

This idea IMO is a vehicle to extending relations to the infinite
case. We can't scan infinite relations in principle, but can join them
by the means of the indexes -- that is the functions.


I do not see how your exercise, whilst no doubt cute, discredits the
idea that FP can be fruitfully applied to the data management field.
Care to provide the missing link/s in your logical chain, like, 'in the
RA we can do such and so, but in FP we cannot, therefore, FP is really
no good'. Besides, on its face, the exercise is not really relevant to
the RA data management. Are you talking about something like constraint
databases where you operate with formulas rather than data ?



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.