Thanks for your suggestions,
and I have another question.
For example,in RDBMS I have 3 tables:orders,item,order_item
and in table order_item have two PK:order_id,item_id.
Usually,I use order_id to find item_id and use item_id to find orderid.
If I use order_id +"_"+ item_id to be the rowkey in hbase, will it be
slower than on PK be the rowkey.
Or create 2 table
create 'ordertoitem','item_id' with rowkey->order_d
create 'itemtoorder',order_id' with rowkey->item_id will be faster?
2012/3/15 Stephen Boesch <[email protected]>
> Presumably you mean " there are more than one UNIQUE key" (only one pk per
> table, even in rdbms..)
>
> Thats a core difference between rdbms and hbase: secondary indexes are not
> suppoted per se in the latter. There are various options here, one of
> which may be to:
>
>
> - you might see whether you can combine your disparate unique keys into
> one combined one for use in hbase. may likely not be possible, but at
> least
> consider.
> - denormalize by creating separate htable's corresponding to each of
> the unique keys. in that case you may not want to store all columns in
> both
> tables: just the columns needed when you query by the specific unique key
> for that table.
> - partition your data well in terms of the regions and then do full scan
> on just the regions you need in order to achieve the queries by the
> secondary indexes
> - export your hbase data into an external full text searchable module (a
> la lucene)
>
>
> 2012/3/14 韶隆吴 <[email protected]>
>
> > Hi all:
> > I'm trying to import data from oracle to hbase and now I have a
> problem.
> > In some tables,there have more than one primary key and they all use a
> > lot.
> > How to design the rowkey in these tables to make them searched
> quickly?
> >
>