Deduplicate spilling explain code

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      A code to add SpillingStats to explain is repeat A LOT across the code base:

      bob->appendBool("usedDisk", (spec->spillingStats.getSpills() > 0));            bob->appendNumber("spills", static_cast<long long>(spec->spillingStats.getSpills()));            bob->appendNumber("spilledRecords",                              static_cast<long long>(spec->spillingStats.getSpilledRecords()));            bob->appendNumber("spilledBytes",                              static_cast<long long>(spec->spillingStats.getSpilledBytes()));            bob->appendNumber(                "spilledDataStorageSize",                static_cast<long long>(spec->spillingStats.getSpilledDataStorageSize())); 

      Given that it contains some simple logic (usedDisk) and a cast to <long long> that may be a subject to refactoring in the future, I propose to create an accessible helper function like addToBson within SpillingStats class that can be used everywhere.

            Assignee:
            Unassigned
            Reporter:
            Ivan Fefer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: