Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-92232

Create property-based test to assert that pruned plans are not better than remaining plans

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • QO 2024-08-05, QO 2024-08-19, QO 2024-09-02, QO 2024-09-16, QO 2024-09-30, QO 2024-10-14

      As we refine our index pruning logic with SERVER-86639 SERVER-86510 and followups, we run the risk of getting the logic wrong in a way that prunes plans that are actually better than the unpruned plans. Pruning a good plan is very bad

      To mitigate this, we can write a property-based test using fastcheck. It can create many indexes, and run an explain query with index pruning on and off. Then it can assert that the works done during multiplanning by the pruned plans is always less than or equal to the maximum works from the unpruned plans.

      We can write many hand-written tests for future index pruning tickets, but it's easy to miss a case. PBT can help find corner cases we missed. 

            Assignee:
            samuel.mercier@mongodb.com Sam Mercier
            Reporter:
            matt.boros@mongodb.com Matt Boros
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: