text: -- @author balasr3
  -- @description TPC-H query02
  -- @created 2012-07-26 22:04:56
  -- @modified 2012-07-26 22:04:56
  -- @tags orca
  
  BEGIN;
  INSERT INTO region (r_name, r_comment) values ('QUERY EXECUTION', 'SAVEPOINT_NAME');
  SAVEPOINT sp_SAVEPOINT_NAME;
  INSERT INTO region (r_name, r_comment) values ('QUERY EXECUTION', 'inner_SAVEPOINT_NAME');
  
  select
  	s_acctbal,
  	s_name,
  	n_name,
  	p_partkey,
  	p_mfgr,
  	s_address,
  	s_phone,
  	s_comment
  from
  	part,
  	supplier,
  	partsupp,
  	nation,
  	region
  where
  	p_partkey = ps_partkey
  	and s_suppkey = ps_suppkey
  	and p_size = 42
  	and p_type like '%NICKEL'
  	and s_nationkey = n_nationkey
  	and n_regionkey = r_regionkey
  	and r_name = 'MIDDLE EAST'
  	and ps_supplycost = (
  		select
  			min(ps_supplycost)
  		from
  			partsupp, supplier,
  			nation, region
  		where
  			p_partkey = ps_partkey
  			and s_suppkey = ps_suppkey
  			and s_nationkey = n_nationkey
  			and n_regionkey = r_regionkey
  			and r_name = 'MIDDLE EAST'
  	)
  order by
  	s_acctbal desc,
  	n_name,
  	s_name,
  	p_partkey
  LIMIT 100;
  
  RELEASE SAVEPOINT sp_SAVEPOINT_NAME;
  COMMIT;
  