Changes between Initial Version and Version 1 of table_example1


Ignore:
Timestamp:
09/14/2012 11:53:48 AM (14 years ago)
Author:
liaojiaohe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • table_example1

    v1 v1  
     1场景大概是:需要记录大量用户的操作Action,需要查询用户最新的行为[[BR]] 
     2 
     3采用数据库设计有类似的SQL 
     4{{{ 
     5SELECT id, name, stamp FROM actions WHERE userid = 1 
     6ORDER BY stamp DESC LIMIT 10 OFFSET 20; 
     7NSERT INTO actions (id, userid, name, stamp) VALUES (newid(), 1, 'Joe User', epoch()); 
     8}}} 
     9 
     10如果采用HBASE设计,ROW设计为<userid><reverse_order_stamp><actionid>