blob: 248c8ba208b7b0bf1d79b7f480f44d14c582cf0d [file] [log] [blame]
khfaraaz82@gmail.comc51d71d2012-08-07 20:36:21 +00001/*
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="Isa"
5 * Expected Result : Success
6 * Issue : Issue 162
7 * Date : 7th August 2012
8 */
9
10drop dataverse test if exists;
11create dataverse test;
12use dataverse test;
13
14create type Emp as closed {
15id:int32,
16fname:string,
17lname:string,
18age:int32,
19dept:string
20}
21
ramangrover29669d8f62013-02-11 06:03:32 +000022create dataset employee(Emp) primary key id;
khfaraaz82@gmail.comc51d71d2012-08-07 20:36:21 +000023
24load dataset employee
25using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
26(("path"="nc1://data/names.adm"),("format"="delimited-text"),("delimiter"="|"));
27
28create index idx_employee_f_l_name on employee(fname,lname);
29
30write output to nc1:"rttest/index-selection_btree-index-composite-key.adm";
31
32for $l in dataset('employee')
33where $l.fname="Julio" and $l.lname="Isa"
34return $l
35