[ 
https://issues.apache.org/jira/browse/LENS-274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14326703#comment-14326703
 ] 

Amareshwari Sriramadasu commented on LENS-274:
----------------------------------------------

While running examples noticed that server is spending 600- 700ms in rewriting:

{noformat}
Query:cube select id,name from sample_dim where name != 'first'
Status:SUCCESSFUL:Query is successful! - Result Available
Total time in millis:670
Driver run time in millis:4
Result:
2       second
3       third
--------------------
Query:cube select id,name from sample_dim order by name
Status:SUCCESSFUL:Query is successful! - Result Available
Total time in millis:744
Driver run time in millis:1
Result:
1       first
2       second
3       third
--------------------
Query:cube select id,name from sample_dim order by name desc
Status:SUCCESSFUL:Query is successful! - Result Available
Total time in millis:732
Driver run time in millis:1
Result:
3       third
2       second
1       first
--------------------
{noformat}

Planning to profile all the resolvers and see how this can be improved. 

> Add estimate api in driver and REST api in server
> -------------------------------------------------
>
>                 Key: LENS-274
>                 URL: https://issues.apache.org/jira/browse/LENS-274
>             Project: Apache Lens
>          Issue Type: Improvement
>          Components: api
>            Reporter: Amareshwari Sriramadasu
>            Assignee: Amareshwari Sriramadasu
>             Fix For: 2.1
>
>
> Add estimate api in LensDriver with following :
> * Estimates the query cost
> * Should return with very less latency - in 10 of milli seconds.
>   /**
>    * Estimates the query cost.
>    * This should be returned with very less latency - should return in 10 of 
> milli seconds.
>    * @param ctx The query context
>    *
>    * @return The query cost object indicating estimated run time and resource 
> usage.
>    * @throws LensException the lens exception if cannot estimate 
>    */
>   QueryCost estimate(AbstractQueryContext ctx) throws LensException;
> h3. Why do we need such api besides explain?
> Explain is more elaborative which gives plan of the query with respect to 
> execution as well. When we are using explain for comparison across drivers, 
> we would need only the cost and the full plan is not required. So, this api 
> will be used to know the query cost and pick an appropriate driver quickly.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to