Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-5982

Overall query metrics not updated if rs.next is called just once

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 4.15.0
    • None
    • None

    Description

      The generic method to issue queries is a variation of the following:

      try (Connection conn = DriverManager.getConnection(url);
        Statement stmt = conn.createStatement()) {
          ResultSet rs = stmt.executeQuery("select * from t");
          while(rs.next()) {
              // do something
          }
      }
      

      However, a client that issues a point lookup may just call rs.next() without the while loop. In that case, overallQueryMetrics will not be updated due to the current logic (see this).

      In this case, it may be better to move this logic to PhoenixResultSet.close() which is a more obvious restriction we can impose on end-client behavior as opposed to a seemingly unnecessary while loop.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ckulkarni Chinmay Kulkarni
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: