[ https://issues.apache.org/jira/browse/PHOENIX-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16044823#comment-16044823 ]
Ethan Wang edited comment on PHOENIX-153 at 6/14/17 5:51 PM: ------------------------------------------------------------- Spec of this patch. Feedback plz. ++ ++Belows are SUPPORTED ++ ===BASE CASE==== select * from Person; select * from PERSON TABLESAMPLE 0.45; ===WHERE CLAUSE==== select * from PERSON where ADDRESS = 'CA' OR name>'tina3'; select * from PERSON TABLESAMPLE 0.49 where ADDRESS = 'CA' OR name>'tina3'; select * from PERSON TABLESAMPLE 0.49 where ADDRESS = 'CA' OR name>'tina3' LIMIT 1; ===Wired Table=== select * from LOCAL_ADDRESS TABLESAMPLE 0.79; select * from SYSTEM.STATS TABLESAMPLE 0.41; ===CORNER CASE=== select * from PERSON TABLESAMPLE 0; select * from PERSON TABLESAMPLE 1.45; select * from PERSON TABLESAMPLE kko; ===AGGREGATION=== select count( * ) from PERSON TABLESAMPLE 0.5 LIMIT 2 select count( * ) from (select NAME from PERSON limit 20) ===SUB QUERY=== select * from (select /*+NO_INDEX*/ * from PERSON tablesample 0.1 where Name > 'tina10') where ADDRESS = 'CA' ===QUERY being OPTMIZED=== select * from PERSON tablesample 0.8 (goes to IDX_ADDRESS_PERSON index table, table sample carry on) ++ ++belows are NOT SUPPORTED ++ ===outter join not supporting=== select * from PERSON1, PERSON2 tablesample 0.7 where PERSON1.Name = PERSON2.NAME was (Author: aertoria): Spec of this patch. Feedback plz. ++ ++Belows are SUPPORTED ++ ===BASE CASE==== select * from Person; select * from PERSON TABLESAMPLE 0.45; ===WHERE CLAUSE==== select * from PERSON where ADDRESS = 'CA' OR name>'tina3'; select * from PERSON TABLESAMPLE 0.49 where ADDRESS = 'CA' OR name>'tina3'; select * from PERSON TABLESAMPLE 0.49 where ADDRESS = 'CA' OR name>'tina3' LIMIT 1; ===Wired Table=== select * from LOCAL_ADDRESS TABLESAMPLE 0.79; select * from SYSTEM.STATS TABLESAMPLE 0.41; ===CORNER CASE=== select * from PERSON TABLESAMPLE 0; select * from PERSON TABLESAMPLE 1.45; select * from PERSON TABLESAMPLE kko; ===AGGREGATION=== select count(*) from PERSON TABLESAMPLE 0.5 LIMIT 2 select count(*) from (select NAME from PERSON limit 20) ===SUB QUERY=== select * from (select /*+NO_INDEX*/ * from PERSON tablesample 0.1 where Name > 'tina10') where ADDRESS = 'CA' ===QUERY being OPTMIZED=== select * from PERSON tablesample 0.8 (goes to IDX_ADDRESS_PERSON index table, table sample carry on) ++ ++belows are NOT SUPPORTED ++ ===outter join not supporting=== select * from PERSON1, PERSON2 tablesample 0.7 where PERSON1.Name = PERSON2.NAME > Implement TABLESAMPLE clause > ---------------------------- > > Key: PHOENIX-153 > URL: https://issues.apache.org/jira/browse/PHOENIX-153 > Project: Phoenix > Issue Type: Task > Reporter: James Taylor > Assignee: Ethan Wang > Labels: enhancement > > Support the standard SQL TABLESAMPLE clause by implementing a filter that > uses a skip next hint based on the region boundaries of the table to only > return n rows per region. -- This message was sent by Atlassian JIRA (v6.4.14#64029)