Selection

Like insert, in selection as well, there will be only one pdf for correlated attributes, and all other values are NULL. QUERY:
SELECT * FROM trucks;
OUTPUT:
id | xpos_2_3 | ypos | cargo_4
1 | prod(norm(0,1)#1, norm(0,1)#2) | NULL | hist( 5.1 , 5.3 : 0.2 , 0.3 )#3

We change column names of the output to show which attributes are correlated. For example, in the previous query, column 2 is named xpos_2_3. It means the original column name was xpos, and this column represents column 2 and 3, i.e. xpos and ypos. Similarly, column 4 (cargo_4) represents only column 4. QUERY:
SELECT xpos, ypos, cargo FROM trucks;
OUTPUT: xpos_1_2 | ypos | cargo_3
prod(norm(1 , 2)#1, norm(1 , 2)#2) | NULL | hist(1 , 2: 0.5 , 0.5)#3

In the output, notice ``#x''. This represent history id for that pdf. These ids are used to track the history.

QUERY:
SELECT * FROM trucks WHERE xpos > 0.5;
OUTPUT:
id | xpos_2_3 | ypos | cargo_4
1 | prod(norm(1 , 2)#204, norm(1 , 2)#205) | x0 > 0.5 | NULL| hist(1 , 2: 0.5 , 0.5)#206

Notice ``x0 > 0.5''. x0 represents first dimention of the pdf. ``x0 > 0.5'' means that there is a floor on the pdf with first dimension greater than 0.5 .

QUERY:
SELECT ypos, cargo FROM trucks where xpos > 0.5;
OUTPUT:
ypos_1 | cargo_2
marg(prod(norm(1 , 2)#204, norm(1 , 2)#205) | x0 > 0.5, x1) | hist(1 , 2: 0.5 , 0.5)#206

Notice the marg() function. This means, that we need only second (x1) dimention of the pdf. First floor is computed, and then it is marginlized.

Rohit Jain 2011-08-02