Uploaded image for project: 'Marmotta'
  1. Marmotta
  2. MARMOTTA-575

SELECT queries over a free subject generated to many CROSS JOINs

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 3.3.0
    • Fix Version/s: 3.3.0
    • Component/s: KiWi Triple Store
    • Labels:

      Description

      In the typical usage of SPARQL retrieving all properties for a concrete type:

      SELECT ?uri ?var1 ?var2 ?varN
      WHERE {
        ?uri a ex:type ;
          ex:var1 ?var1 ;
          ex:var2 ?var2 ;
          ex:varN ?varN .
      }
      

      KiWI performs quite bad, because it creates a CROSS JOIN for each property:

      SELECT PN.object AS VN, P2.object AS V2, P1.subject AS V1
       FROM triples P1
       CROSS JOIN 
        triples P2
       CROSS JOIN 
        triples PN
       WHERE P1.deleted = false
            AND P1.predicate = 520554470573084672
            AND P1.object = 520588903665881088
            AND (P1.context = 539803406462763008)
             AND P2.deleted = false
            AND P1.subject = P2.subject
            AND P2.predicate = 520554473039335424
            AND (P2.context = 539803406462763008)
             AND PN.deleted = false
            AND P1.subject = PN.subject
            AND PN.predicate = 527860595421151232
            AND (PN.context = 539803406462763008)
      

      Making the subject fixed is actually a quite fast query.

        Attachments

          Activity

            People

            • Assignee:
              wikier Sergio Fernández
              Reporter:
              wikier Sergio Fernández
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: