Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-12251

Null Props Cause Incorrect Query Estimation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • None
    • None
    • Oak
    • None

    Description

      Using null props in a query can cause the query engine to incorrectly estimate the cost of query plan which can lead to a traversal and slow queries to execute.

       

      If you look at the query plan below the number of null props documents is quiet high yet the cost for the query is only 19. When we execute the UNION query the cost is 38 which is why it is not selected when in reality the original cost should be much higher.

       

      After removing the null check the cost estimation is drastically different and correctly reflects the number of documents in the index.

       

      Attachments

        1. Non Union With Null Check.json
          8 kB
          Patrique Legault
        2. Screenshot 2024-02-13 at 10.17.31 AM.png
          93 kB
          Patrique Legault
        3. Non Union Query Plan.json
          8 kB
          Patrique Legault
        4. Union Query Plan.json
          5 kB
          Patrique Legault
        5. cqTagLucene.json
          2 kB
          Patrique Legault

        Activity

          People

            Unassigned Unassigned
            patlego Patrique Legault
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: