Thank you James !

I filed a new JIRA  https://issues.apache.org/jira/browse/PHOENIX-3033.



[email protected]
 
From: James Taylor
Date: 2016-06-28 13:04
To: user
Subject: Re: how to avoid full scan
Hi,
One way to forbid a full table scan, is to have your own client which compiles 
the query first (you'd need to dip down under JDBC -- see 
QueryComilerTest.getQueryPlan() for an example) to get the QueryPlan. You can 
then easily detect if it's a full table scan looking at the ScanRanges from 
queryPlan.getContext().getScanRanges(). With a full table scan, 
scanRanges.getBoundSlotCount()==0.

For most queries (non join, non union queries), you could even get an estimate 
of the number of bytes that will be scanned using 
BaseQueryPlan.getEstimatedByteCount(). FWIW, we have an open JIRA to add this 
method to QueryPlan. Using this mechanism, you could even allow a full table 
scan based on the max number of bytes that will be scanned.

This would be a good feature to add to Phoenix IMHO. Please file a JIRA. One 
word of caution - the above APIs aren't public and will change with our 5.0 
release. There will be an equivalent, but different way of getting the same 
information, though.

Thanks,
James



On Tue, Jun 28, 2016 at 5:10 AM, [email protected] <[email protected]> wrote:
hi, 
Our hbase cluster is often over load because of a careless phoenix full scan.
Is there anything I can do to void this?

I want to forbid full scan on specified table. How to do it?



[email protected]

Reply via email to