Details

      Description

      The following query:

      SELECT
              ?item ?itemLabel
      WHERE
      {
      ?item wdt:P31/wdt:P279* wd:Q1651051 .
      ?item wdt:P31 ?instance .
      SERVICE wikibase:label {
            bd:serviceParam wikibase:language "it,en" .
      }
      }
      

      finishes in under a second, and returns ~43 results. However after adding a triple to service clause:

      SELECT
              ?item ?itemLabel
      WHERE
      {
      ?item wdt:P31/wdt:P279* wd:Q1651051 .
      ?item wdt:P31 ?instance .
      SERVICE wikibase:label {
            bd:serviceParam wikibase:language "it,en" .
            ?item rdfs:label ?itemLabel
      }
      }
      

      the query takes over 2 minutes and returns over 10K results. Looks like the optimizer mishandles the triple inside service clause.

        Activity

        Hide
        michaelschmidt michaelschmidt added a comment -

        Quick fix as proposed per above in https://github.com/blazegraph/bigdata/pull/492, now in CI. Unfortunately how code swapping did not work, could you please test the fix @Stas?

        Show
        michaelschmidt michaelschmidt added a comment - Quick fix as proposed per above in https://github.com/blazegraph/bigdata/pull/492 , now in CI. Unfortunately how code swapping did not work, could you please test the fix @Stas?
        Hide
        michaelschmidt michaelschmidt added a comment -

        Regarding your temporary solution @Stas: please remove it again when testing the fix above.

        Show
        michaelschmidt michaelschmidt added a comment - Regarding your temporary solution @Stas: please remove it again when testing the fix above.
        Hide
        stasmalyshev stasmalyshev added a comment -

        Will test the patch. Also, we do want label service to run last, since there's almost no situation it will be beneficial to run it before all the data is in. I can try to make the optimizer to add runLast hint, I think - would that be beneficial?

        Show
        stasmalyshev stasmalyshev added a comment - Will test the patch. Also, we do want label service to run last, since there's almost no situation it will be beneficial to run it before all the data is in. I can try to make the optimizer to add runLast hint, I think - would that be beneficial?
        Hide
        michaelschmidt michaelschmidt added a comment -

        Yes, adding (in addition to the patch) the runLast hint for the label service definitely sounds reasonable to me.

        Show
        michaelschmidt michaelschmidt added a comment - Yes, adding (in addition to the patch) the runLast hint for the label service definitely sounds reasonable to me.
        Hide
        michaelschmidt michaelschmidt added a comment -

        PR https://github.com/blazegraph/bigdata/pull/492 was updated, CI green now. Please review.

        Show
        michaelschmidt michaelschmidt added a comment - PR https://github.com/blazegraph/bigdata/pull/492 was updated, CI green now. Please review.

          People

          • Assignee:
            igorkim igorkim
            Reporter:
            stasmalyshev stasmalyshev
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: