salsubaiee | 3c59d76 | 2013-02-06 09:10:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Description : Test that BTree index is used in query plan |
| 3 | * : define the BTree index on a composite key (fname,lanme) |
| 4 | * : predicate => where $l.fname > "Julio" and $l.lname > "Mattocks" and |
| 5 | * $l.fname <= "Micco" and $l.lname < "Vangieson" |
| 6 | * Expected Result : Success |
| 7 | * Issue : Issue 174 |
| 8 | * Date : 5th Feb, 2013 |
| 9 | */ |
| 10 | |
| 11 | drop dataverse test if exists; |
| 12 | create dataverse test; |
| 13 | use dataverse test; |
| 14 | |
| 15 | create type Emp as closed { |
| 16 | id:int32, |
| 17 | fname:string, |
| 18 | lname:string, |
| 19 | age:int32, |
| 20 | dept:string |
| 21 | } |
| 22 | |
kisskys | f4c3324 | 2013-03-13 06:11:01 +0000 | [diff] [blame] | 23 | create dataset employee(Emp) primary key id; |
salsubaiee | 3c59d76 | 2013-02-06 09:10:05 +0000 | [diff] [blame] | 24 | |
| 25 | load dataset employee |
| 26 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 27 | (("path"="nc1://data/names.adm"),("format"="delimited-text"),("delimiter"="|")); |
| 28 | |
| 29 | create index idx_employee_f_l_name on employee(fname,lname); |
| 30 | |
| 31 | write output to nc1:"rttest/index-selection_btree-index-composite-key-mixed-intervals.adm"; |
| 32 | |
| 33 | for $l in dataset('employee') |
| 34 | where $l.fname > "Julio" and $l.lname > "Mattocks" and $l.fname <= "Micco" and $l.lname < "Vangieson" |
| 35 | order by $l.id |
| 36 | return $l |
| 37 | |