That's interesting, I had a similar idea. But first we would like to model the array with two tables, which sound to be simpler. I contact you If I'll have time to work on the issue.
On Mon, Jun 22, 2015 at 12:10 AM James Taylor <[email protected]> wrote: > Hey Leon, > I filed PHOENIX-1544 a while back for indexing arrays over immutable > tables. If you're interested in contributing a patch, that'd be great. > I'm happy to help you along the way. > Thanks, > James > > On Sun, Jun 21, 2015 at 12:48 AM, Leon Prouger <[email protected]> wrote: > > Hey James, thank you for replying. > > Yes you're right, this option is pretty useless is our case. We've been > > thinking to create a separate table which will model the array with one > to > > many relation, then index it and perform join with the main table for > every > > query. Like: > > > > Main table: PK(id), data columns > > Array table: PK(id, array cell), index of the array cell > > > > But I wonder is the join gonna be faster then full scan of the main > table. > > > > Is there any plans for implementing an array index? Maybe it can be done > for > > immutable tables only. > > > > > > On Wed, Jun 17, 2015 at 10:05 PM James Taylor <[email protected]> > > wrote: > >> > >> Hey Leon, > >> You can have an array in an index, but it has to be at the end of the > >> PK constraint which is not very useful and likely not what you want - > >> it'd essentially be equivalent of having the array at the end of your > >> primary key constraint. > >> > >> The other alternative I can think of that may be more useful is to use > >> functional indexing[1] on specific array elements. You'd need to know > >> the position of the element that you're indexing and querying against > >> in advance, though. > >> > >> [1] http://phoenix.apache.org/secondary_indexing.html#Functional_Index > >> > >> On Wed, Jun 17, 2015 at 4:43 AM, Leon Prouger <[email protected]> > wrote: > >> > Hey folks, > >> > > >> > Maybe I'm asking too much but I couldn't find a straight answer. Is > this > >> > possible to index an array type with Phoenix? > >> > > >> > If I can't does anybody tried any alternatives? Like keeping another > >> > table > >> > for the array many to one relation >
