[ https://issues.apache.org/jira/browse/PHOENIX-1267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14163189#comment-14163189 ]
James Taylor commented on PHOENIX-1267: --------------------------------------- Thanks for the patch, [~jaywong]. Please encapsulate this complete behind the implementors of QueryPlan. More specifically: - Add a protected method called isSmallScan in BaseQueryPlan. - Override this method in ScanPlan (which is the plan for non aggregate queries) with the part of your logic from isScanForbidden. You'd want to check if order by is not empty here - I don't think topN is the correct criteria. - Also override the method in AggregatePlan. I think you always want to return false here. - I don't think you need to do anything special for joins. - In the BaseQueryPlan.iterators() method you can call scan.setScanSmall(). First call isSmallScan(). Then call statement.getHint().hasHint(Hint.SMALL_SCAN) and statement.getHint().hasHint(Hint.NO_SMALL_SCAN) to override the value you got from isSmallScan(). Based on this logic, you'll have the correct value to use for scan.setScanSmall(). > Set scan.setSmall(true) when appropriate > ---------------------------------------- > > Key: PHOENIX-1267 > URL: https://issues.apache.org/jira/browse/PHOENIX-1267 > Project: Phoenix > Issue Type: Bug > Reporter: James Taylor > Assignee: jay wong > Attachments: smallscan.patch, smallscan2.patch > > > There's a nice optimization that has been in HBase for a while now to set a > scan as "small". This prevents extra RPC calls, I believe. We should add a > hint for queries that forces it to be set/not set, and make our best guess on > when it should default to true. -- This message was sent by Atlassian JIRA (v6.3.4#6332)