You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/10/28 08:26:06 UTC

[GitHub] [calcite] danny0405 commented on a change in pull request #1529: [CALCITE-3442] In ElasticSearch adapter, set `stored_fields = _none_` to prohibit FetchPhase get involved

danny0405 commented on a change in pull request #1529: [CALCITE-3442] In ElasticSearch adapter, set `stored_fields = _none_` to prohibit FetchPhase get involved 
URL: https://github.com/apache/calcite/pull/1529#discussion_r339441621
 
 

 ##########
 File path: elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java
 ##########
 @@ -186,6 +186,11 @@ String scriptedFieldPrefix() {
     query.put("_source", false);
     query.put("size", 0);
     query.remove("script_fields");
+    // set _source = false and size = 0, `FetchPhase` would still be executed
+    // to fetch the metadata fields and visit the Lucene stored_fields,
+    // which would lead to performance declined dramatically.
+    // `stored_fields = _none` can prohibit such behavior entirely
+    query.put("stored_fields", "_none_");
 
 Review comment:
   Sounds reasonable, do you think we can add a test case for this ? Some code to  illustrates that the `FetchPhase` you mentioned has indeed been triggered without your fix.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services