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

select
    n_name,
    o_year,
    sum(amount) as sum_profit
from
    (
        select
            n_name,
            DATE_PART('YEAR',o_orderdate) as o_year,
            l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
        from
            part,
            supplier,
            lineitem,
            partsupp,
            orders,
            nation
        where
            s_suppkey = l_suppkey
            and ps_suppkey = l_suppkey
            and ps_partkey = l_partkey
            and p_partkey = l_partkey
            and o_orderkey = l_orderkey
            and s_nationkey = n_nationkey
            and p_name like '%green%'
            and s_acctbal :varies
            and ps_supplycost :varies
    ) as profit
group by
    n_name,
    o_year
order by
    n_name,
    o_year desc

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