khfaraaz82@gmail.com | 552e4c8 | 2012-08-19 07:37:50 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Description : BTree Index verification (usage) test |
| 3 | * : This test is intended to verify that the secondary BTree index is NOT used |
| 4 | * : in the optimized query plan. |
| 5 | * Expected Result : Success |
| 6 | * Date : 13th Aug 2012 |
| 7 | */ |
| 8 | |
| 9 | // This is a Negative test - prefix search, BTree index should not be used in the plan. |
| 10 | |
| 11 | drop dataverse test if exists; |
| 12 | create dataverse test; |
| 13 | use dataverse test; |
| 14 | |
| 15 | write output to nc1:"rttest/btree-index_btree-secondary-32.adm"; |
| 16 | |
| 17 | create type TestType as open { |
| 18 | id : int32, |
| 19 | fname : string, |
| 20 | lname : string |
| 21 | } |
| 22 | |
| 23 | // create internal dataset |
| 24 | create dataset testdst(TestType) partitioned by key id; |
| 25 | |
| 26 | // create secondary index |
| 27 | create index sec_Idx on testdst(fname,lname); |
| 28 | |
| 29 | // load valid data with fname and lname entries |
| 30 | |
| 31 | load dataset testdst |
| 32 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 33 | (("path"="nc1://data/id-fn-ln.adm"),("format"="delimited-text"),("delimiter"="|")); |
| 34 | |
| 35 | // Query the data that was loaded above. |
| 36 | |
| 37 | for $emp in dataset('testdst') |
| 38 | where $emp.fname >= "Susan" |
| 39 | return $emp |