Demo 3a
select    sum(l_extendedprice * l_discount) as revenue
from      lineitem
where     l_shipdate >= TO_DATE('1994-01-01', 'YYYY-MM-DD')
          and l_shipdate < TO_DATE('1994-01-01', 'YYYY-MM-DD') + NUMTOYMINTERVAL(1,'year')
          and l_discount between 0.06 - 0.01 and 0.06 + 0.01
          and l_quantity < 24;

Oracle Execution Plan

Operation: table access
Options: FULL
Object_type: TABLE
Other: 
Object_owner: CALUSER01
Search_columns: 
Projection: L_EXTENDEDPRICE^L_DISCOUNT
Object_name: LINEITEM
Alias: LINEITEM@SEL$1
Extended_information:    FP:L_SHIPDATE>=TO_DATE('1994-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND L_SHIPDATE<TO_DATE('1995-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND L_DISCOUNT>=.05 AND L_DISCOUNT<=.07 AND L_QUANTITY<24
Access_predicates: 
Filter_predicates: L_SHIPDATE>=TO_DATE('1994-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss')&L_SHIPDATE<TO_DATE('1995-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss')&L_DISCOUNT>=.05&L_DISCOUNT<=.07&L_QUANTITY<24
Select_level: SEL$1
--------------------
Operation: sort
Options: AGGREGATE
Object_type: 
Other: 
Object_owner: 
Search_columns: 
Projection:  SUM(L_EXTENDEDPRICE*L_DISCOUNT)
Object_name: 
Alias: 
Extended_information: 
Access_predicates: 
Filter_predicates: 
Select_level: SEL$1
--------------------
Operation: select statement
Options: 
Object_type: 
Other: 
Object_owner: 
Search_columns: 
Projection: 
Object_name: 
Alias: 
Extended_information: 
Access_predicates: 
Filter_predicates: 
Select_level: 
--------------------

Calpont Execution Plan

>SELECT MAIN
>>Returned Columns
1. ArithmeticColumn: AggregateColumn sum(L_EXTENDEDPRICE*L_DISCOUNT)
ArithmeticColumn: SimpleColumn L_EXTENDEDPRICE
  s/t/c/T/A: ///0/

SimpleColumn L_DISCOUNT
  s/t/c/T/A: ///0/

Operator: *


>>Filters
SimpleFilter
  SimpleColumn tpch.LINEITEM.L_SHIPDATE
  s/t/c/T/A: tpch/LINEITEM/L_SHIPDATE/35/
  Operator: >=  ArithmeticColumn: FunctionColumn: to_date('1994-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss')

SimpleFilter
  SimpleColumn tpch.LINEITEM.L_SHIPDATE
  s/t/c/T/A: tpch/LINEITEM/L_SHIPDATE/35/
  Operator: <  ArithmeticColumn: FunctionColumn: to_date('1995-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss')

Operator: AND
SimpleFilter
  SimpleColumn tpch.LINEITEM.L_DISCOUNT
  s/t/c/T/A: tpch/LINEITEM/L_DISCOUNT/31/LINEITEM
  Operator: >=  ConstantColumn: .05(n)
Operator: AND
SimpleFilter
  SimpleColumn tpch.LINEITEM.L_DISCOUNT
  s/t/c/T/A: tpch/LINEITEM/L_DISCOUNT/31/LINEITEM
  Operator: <=  ConstantColumn: .07(n)
Operator: AND
SimpleFilter
  SimpleColumn tpch.LINEITEM.L_QUANTITY
  s/t/c/T/A: tpch/LINEITEM/L_QUANTITY/29/
  Operator: <  ConstantColumn: 24(n)
Operator: AND
>>Group By Columns
ArithmeticColumn: AggregateColumn sum(L_EXTENDEDPRICE*L_DISCOUNT)
ArithmeticColumn: SimpleColumn L_EXTENDEDPRICE
  s/t/c/T/A: ///0/

SimpleColumn L_DISCOUNT
  s/t/c/T/A: ///0/

Operator: *

SessionID: 5004
TxnID: 409
VerID: 409

--- Column Map ---
L_DISCOUNT : 0x834c718
L_EXTENDEDPRICE : 0x8345de8
L_QUANTITY : 0x8365ba0
L_SHIPDATE : 0x8365980

