You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Lars Hofhansl (JIRA)" <ji...@apache.org> on 2014/03/24 05:07:43 UTC

[jira] [Commented] (PHOENIX-150) Support nested child rows

    [ https://issues.apache.org/jira/browse/PHOENIX-150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13944727#comment-13944727 ] 

Lars Hofhansl commented on PHOENIX-150:
---------------------------------------

Another way of looking at this is to even provide proximity between the parent and child rows.

In HBase that can be done easily by having the child row key be prefixed with the parent's row key.
Then all children pertaining to a particular parent row would sort together with the parent right after it.
That is a very easy and natural way to model master-detail type relationship. It can obviously only be used to model one-to-many relationships.

I.e. say parent has a PK of X,Y. Then the child table would have a PK of X,Y,Z. One could then even define an HBase split policy that does not split inside of the X,Y portion and then have MVCC transactions between all children of the same parent (and including the parent).

The only downside would be scanning only rows in the parent table, which now would have to skip all rows of the children. 


> Support nested child rows
> -------------------------
>
>                 Key: PHOENIX-150
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-150
>             Project: Phoenix
>          Issue Type: Task
>            Reporter: James Taylor
>            Assignee: Anoop Sam John
>              Labels: enhancement
>
> Unlike with standard relational databases, HBase allows you the flexibility of dynamically creating as many key values in a row as you'd like. Phoenix could leverage this by providing a way to model child rows inside of a parent row. The child row would be comprised of the set of key values whose column qualifier is prefixed with a known name and appended with the primary key of the child row. Phoenix could hide all this complexity, and allow querying over the nested children through joining to the parent row.



--
This message was sent by Atlassian JIRA
(v6.2#6252)