Sample Picasso Diagrams » QT7  (11 Slides)     [Page 1 of 1] :: Jump To  
Query Template

select
    supp_nation,
    cust_nation,
    l_year,
    sum(volume) as revenue
from
    (
        select
            n1.n_name as supp_nation,
            n2.n_name as cust_nation,
            DATE_PART('YEAR',l_shipdate) as l_year,
            l_extendedprice * (1 - l_discount) as volume
        from
            supplier,
            lineitem,
            orders,
            customer,
            nation n1,
            nation n2
        where
            s_suppkey = l_suppkey
            and o_orderkey = l_orderkey
            and c_custkey = o_custkey
            and s_nationkey = n1.n_nationkey
            and c_nationkey = n2.n_nationkey
            and (
                (n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY')
                or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')
            )
            and l_shipdate between '1995-01-01' and '1996-12-31'
            and o_totalprice :varies
            and c_acctbal :varies
    ) as shipping
group by
    supp_nation,
    cust_nation,
    l_year
order by
    supp_nation,
    cust_nation,
    l_year

Optimizer Diagrams
  Up one level  
Plan Diagram * 1919 x 1125 * (96KB)
Reduced Diagram (20%) * 1919 x 1125 * (96KB)
Cardinality Diagram * 1919 x 1125 * (101KB)
Cost Diagram * 1919 x 1125 * (99KB)
Plan1 * 1919 x 1125 * (65KB)
  Plan Diagram  
  Reduced Diagram (20%)  
  Cardinality Diagram  
  Cost Diagram  
  Plan1  
Plan2 * 1919 x 1125 * (68KB)
Plan3 * 1919 x 1125 * (68KB)
Plan4 * 1919 x 1125 * (69KB)
Plan5 * 1919 x 1125 * (69KB)
Plan6 * 1919 x 1125 * (67KB)
  Plan2  
  Plan3  
  Plan4  
  Plan5  
  Plan6  
Plan7 * 1919 x 1125 * (76KB)
  Plan7  
Album last updated on 2/9/09 9:58 PM
Powered by Jalbum 8.1 and BluPlusPlus skin
Indian Institute of Science