namhnguyen / asterixdb

Automatically exported from code.google.com/p/asterixdb
0 stars 0 forks source link

Improve Index Search Capabilities for Indexes on multiple fields #813

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following query does not use the secondary index that is created:

drop dataverse test if exists;
create dataverse test;
use dataverse test;
create type Name as open {
    id: int32,
    fname : string,
    lname : string
}
create dataset names(Name) primary key id;
create index nameIndex on names(fname,lname);
for $emp in dataset('names') 
where $emp.fname > "Alex" and $emp.lname < "Zach"
return $emp;

This is because the two comparators are different (greater than vs less than). 
Currently, this case is ignored when determining whether an index should be 
used. This is because prefix searches have not been implemented yet for this 
case. It would be nice to have them. Relevant code can be found in 
BTreeAccessMethod.java

Original issue reported on code.google.com by sjaco...@ucr.edu on 21 Oct 2014 at 11:10

GoogleCodeExporter commented 9 years ago
This enhancement is already listed in issue 389.

Original comment by sjaco...@ucr.edu on 21 Oct 2014 at 11:18

GoogleCodeExporter commented 9 years ago
Suggested approach is to take the prefix and apply the suffix after the search. 
 :-)

Original comment by dtab...@gmail.com on 22 Oct 2014 at 1:41

GoogleCodeExporter commented 9 years ago

Original comment by sjaco...@ucr.edu on 22 Oct 2014 at 4:38

GoogleCodeExporter commented 9 years ago
Unmerged with 389. That issue dealt with Prefix searching on multi-field 
indexes when the query is on a single field, which doesn't cover this case.

Original comment by sjaco...@ucr.edu on 22 Oct 2014 at 4:41

GoogleCodeExporter commented 9 years ago

Original comment by ildar.absalyamov on 12 Nov 2014 at 12:39

GoogleCodeExporter commented 9 years ago

Original comment by ildar.absalyamov on 6 Feb 2015 at 7:32