alexander.behm | 6db7d30 | 2012-07-29 07:56:44 +0000 | [diff] [blame] | 1 | drop dataverse index_search if exists; |
| 2 | create dataverse index_search; |
| 3 | use dataverse index_search; |
| 4 | |
| 5 | create type OrderType as closed { |
| 6 | o_orderkey: int32, |
| 7 | o_custkey: int32, |
| 8 | o_orderstatus: string, |
| 9 | o_totalprice: double, |
| 10 | o_orderdate: string, |
| 11 | o_orderpriority: string, |
| 12 | o_clerk: string, |
| 13 | o_shippriority: int32, |
| 14 | o_comment: string |
| 15 | } |
| 16 | |
ramangrover29 | 669d8f6 | 2013-02-11 06:03:32 +0000 | [diff] [blame] | 17 | create dataset Orders(OrderType) primary key o_orderkey; |
alexander.behm | 6db7d30 | 2012-07-29 07:56:44 +0000 | [diff] [blame] | 18 | |
| 19 | create index idx_Custkey_Orderstatus on Orders(o_custkey, o_orderstatus); |
| 20 | |
| 21 | write output to nc1:"/tmp/index_search.adm"; |
| 22 | |
| 23 | for $o in dataset('Orders') |
| 24 | where |
| 25 | $o.o_custkey = 40 and $o.o_orderstatus = "P" |
| 26 | return { |
| 27 | "o_orderkey": $o.o_orderkey, |
| 28 | "o_custkey": $o.o_custkey, |
| 29 | "o_orderstatus": $o.o_orderstatus |
| 30 | } |