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

Zain Humayun edited comment on CALCITE-1959 at 8/23/17 6:30 PM:
----------------------------------------------------------------

-I was under the impression that the Schema created was tied to a particular 
connection-. After this change, connecting to Druid clusters without model 
definitions should be much faster. I was also reluctant of testing with an 
assert, however CalciteAssert is used to handle query-related test cases, where 
as this test case is not quite that. Do you recommend I add another method to 
CalciteAssert?


was (Author: zhumayun):
I was under the impression that the Schema created was tied to a particular 
connection. After this change, connecting to Druid clusters without model 
definitions should be much faster. I was also reluctant of testing with an 
assert, however CalciteAssert is used to handle query-related test cases, where 
as this test case is not quite that. Do you recommend I add another method to 
CalciteAssert?

> Reduce the amount of Metadata and table name calls in Druid
> -----------------------------------------------------------
>
>                 Key: CALCITE-1959
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1959
>             Project: Calcite
>          Issue Type: Improvement
>          Components: druid
>            Reporter: Zain Humayun
>            Assignee: Zain Humayun
>             Fix For: 1.14.0
>
>
> Currently in the Druid adapter, when a model definition file is not provided, 
> query times can be quite slow due to excessive metadata and table names 
> calls. Initial investigation reveals that a simple query like
> {code:sql}
> SELECT * from table
> {code}
> produces at least 30 http calls for fetching the table names, and another 30 
> calls for meta data. This slows down the query considerably, even when the 
> individual calls themselves are relatively quick. 
> The source of the issue seems to be {{DruidSchema#getTableMap}}, as this 
> method dispatches calls to both {{DruidConnectionImpl#metadata}} and 
> {{DruidConnectionImpl#tableNames}}. In addition, {{DruidTable#create}} makes 
> another call to {{DruidConnectionImpl#metadata}} even if it's given the 
> populated fields as arguments.
> {{getTableMap}} is called fairly often indirectly from many places, including 
> the validator, so as the query becomes larger, the problems gets a lot worse. 
> Ideally, one would provide a model definition to prevent this, but doing so 
> is not always possible/preferred for users.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to