You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Shuxiong Ye (JIRA)" <ji...@apache.org> on 2015/08/26 08:33:45 UTC

[jira] [Comment Edited] (PHOENIX-2163) Measure performance of Phoenix/Calcite querying

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

Shuxiong Ye edited comment on PHOENIX-2163 at 8/26/15 6:33 AM:
---------------------------------------------------------------

The information in *.out is generated in this way:

For calcite, in \[1\], function getExplainPlan, it is generated by prepending "EXPLAIN PLAN FOR".
{code:java}
  private static String getExplainPlan(String query) {
    StringBuilder buf = new StringBuilder();
    try {
      String expPrefixStr =
          PhoenixConnection.isCalciteConnection() ? "EXPLAIN PLAN FOR " : "EXPLAIN ";
      System.out.println("getExplainPlan query= " + expPrefixStr + query);
      PreparedStatement statement =
          PhoenixConnection.getConnection().prepareStatement(expPrefixStr + query);
      ResultSet rs = statement.executeQuery();

      while (rs.next()) {
        buf.append(rs.getString(1));
        buf.append('\n');
      }
      if (buf.length() > 0) {
        buf.setLength(buf.length() - 1);
      }

      statement.close();
    } catch (Exception e) {
    }
    System.out.println("EXPLAIN: " + buf.toString());
    return buf.toString();
  }
{code}

Calcite use "EXPLAIN PLAN FOR" instead of "EXPLAIN".
So I think *.out is the explain result.

\[1\] https://github.com/shuxiong/PhoenixRegressor/blob/master-calcite/src/main/java/com/salesforce/PhoenixRegressor.java


was (Author: shuxi0ng):
The information in *.out is generated in this way:

For calcite, in \[1\], function getExplainPlan, it is generated by prepending "EXPLAIN PLAN FOR".
{code:java}
  private static String getExplainPlan(String query) {
    StringBuilder buf = new StringBuilder();
    try {
      String expPrefixStr =
          PhoenixConnection.isCalciteConnection() ? "EXPLAIN PLAN FOR " : "EXPLAIN ";
      System.out.println("getExplainPlan query= " + expPrefixStr + query);
      PreparedStatement statement =
          PhoenixConnection.getConnection().prepareStatement(expPrefixStr + query);
      ResultSet rs = statement.executeQuery();

      while (rs.next()) {
        buf.append(rs.getString(1));
        buf.append('\n');
      }
      if (buf.length() > 0) {
        buf.setLength(buf.length() - 1);
      }

      statement.close();
    } catch (Exception e) {
    }
    System.out.println("EXPLAIN: " + buf.toString());
    return buf.toString();
  }
{code}

Calcite use "EXPLAIN PLAN FOR" instead of "EXPLAIN".

\[1\] https://github.com/shuxiong/PhoenixRegressor/blob/master-calcite/src/main/java/com/salesforce/PhoenixRegressor.java

> Measure performance of Phoenix/Calcite querying
> -----------------------------------------------
>
>                 Key: PHOENIX-2163
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2163
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: Shuxiong Ye
>         Attachments: PHOENIX-2163.patch, calcite-test-mac.tar.gz
>
>
> The work to integrate Phoenix with Calcite has come along far enough that queries both against the data table and through a secondary index is functional. As a checkpoint, we should compare performance of as many queries as possible in our regression suite for the calcite branch against the latest Phoenix release (4.5.0). The runtime of these two systems should be the same, so this will give us an idea of the overhead of query parsing and compilation for Calcite. This is super important, as it'll identify outstanding work that'll be necessary to do prior to any releases on top of this new stack.
> Source code of regression suite is at https://github.com/mujtabachohan/PhoenixRegressor
> Connection string location: https://github.com/mujtabachohan/PhoenixRegressor/blob/master/src/main/resources/settings.json
> Instructions on how to compile and run: https://github.com/mujtabachohan/PhoenixRegressor/blob/master/README.md



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