Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-1436

hint:runLast ignored for ALP and possibly VALUES

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: BLAZEGRAPH_RELEASE_1_5_3
    • Component/s: None
    • Labels:
      None

      Description

      Per an email thread, the RunFirstRunLastOptimizer computes the wrong index for the lastJoinIndex (and possible the same problem exists for runFirst). The proposed fix is below.

      Mike wrote: It is a query that has two AST nodes - an ALP node and a UnionNode. The ALP node is used to match elements, the UnionNode is used to fetch the properties for the matched elements. The Union must run last or it will fetch the entire database.

                  if (last != null) {
                  	
                      log.debug(last.getClass());
                      
                      int lastJoinIndex = 0;
                      for (int i = joinGroup.size()-1; i >= 0; i--) {
                      	if (joinGroup.get(i) instanceof IBindingProducerNode) { // <== PROPOSED CHANGE
                      		lastJoinIndex = i;
                      		break;
                      	}
                      }
                      
      		        joinGroup.removeChild(last);
      		        
      		        joinGroup.addArg(lastJoinIndex, (BOp) last);
                  	
                  }
      

        Activity

        Hide
        bryanthompson bryanthompson added a comment -

        Assigned to Michael to review the proposed change and look at the runFirst behavior as well.

        Show
        bryanthompson bryanthompson added a comment - Assigned to Michael to review the proposed change and look at the runFirst behavior as well.
        Hide
        bryanthompson bryanthompson added a comment -

        This has already been merged to master with the proposed change.

        Applied the change to the runFirst query hint as well.

        Commit to master 40ef907

        Show
        bryanthompson bryanthompson added a comment - This has already been merged to master with the proposed change. Applied the change to the runFirst query hint as well. Commit to master 40ef907

          People

          • Assignee:
            michaelschmidt michaelschmidt
            Reporter:
            bryanthompson bryanthompson
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: