Sample Picasso Diagrams » QT8  (21 Slides)     [Page 1 of 2] :: Jump To  
Query Template

select
    o_year,
    sum(case
        when nation = 'BRAZIL' then volume
        else 0
    end) / sum(volume) as mkt_share
from
    (
        select
            DATE_PART('YEAR',o_orderdate) as o_year,
            l_extendedprice * (1 - l_discount) as volume,
            n2.n_name as nation
        from
            part,
            supplier,
            lineitem,
            orders,
            customer,
            nation n1,
            nation n2,
            region
        where
            p_partkey = l_partkey
            and s_suppkey = l_suppkey
            and l_orderkey = o_orderkey
            and o_custkey = c_custkey
            and c_nationkey = n1.n_nationkey
            and n1.n_regionkey = r_regionkey
            and r_name = 'AMERICA'
            and s_nationkey = n2.n_nationkey
            and o_orderdate between '1995-01-01' and '1996-12-31'
            and p_type = 'ECONOMY ANODIZED STEEL'
            and s_acctbal :varies
            and l_extendedprice :varies
    ) as all_nations
group by
    o_year
order by
    o_year

Optimizer Diagrams
  You have reached the first page You have reached the first page      Up one level      Next page Last page  
Plan Diagram * 1919 x 1125 * (101KB)
Reduced Diagram (20%) * 1919 x 1125 * (98KB)
Cardinality Diagram * 1919 x 1125 * (104KB)
Cost Diagram * 1919 x 1125 * (101KB)
Plan1 * 1919 x 1125 * (68KB)
  Plan Diagram  
  Reduced Diagram (20%)  
  Cardinality Diagram  
  Cost Diagram  
  Plan1  
Plan2 * 1919 x 1125 * (84KB)
Plan3 * 1919 x 1125 * (81KB)
Plan4 * 1919 x 1125 * (82KB)
Plan5 * 1919 x 1125 * (82KB)
Plan6 * 1919 x 1125 * (83KB)
  Plan2  
  Plan3  
  Plan4  
  Plan5  
  Plan6  
Plan7 * 1919 x 1125 * (73KB)
Plan8 * 1919 x 1125 * (82KB)
Plan9 * 1919 x 1125 * (84KB)
Plan10 * 1919 x 1125 * (83KB)
Plan11 * 1919 x 1125 * (83KB)
  Plan7  
  Plan8  
  Plan9  
  Plan10  
  Plan11  
Album last updated on 2/9/09 9:58 PM
Powered by Jalbum 8.1 and BluPlusPlus skin
Indian Institute of Science