29.01.2014 Views

Tutorial slides

Tutorial slides

Tutorial slides

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Compressing ADC<br />

Won’t have all tricks of prior slide in any current DBMS<br />

But we can usually compress adjoined dimension columns to<br />

small ints: use UDF for mapping so Store.Nation = ‘United<br />

States’ maps to small int 7<br />

create function NATcode (nat char(18)) returns small int<br />

…<br />

return case nat<br />

when ‘United Kingdom’ then 1<br />

…<br />

when ‘United States’ then 7<br />

…<br />

end<br />

Now a user can write:<br />

Select … from POS where S_Nation = Natcode(‘United States’)…<br />

Natcode will translate ‘United States’ to the int 7; thus all ADC<br />

can be two-byte (or less) small ints with proper UDFs defined<br />

45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!