Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-1908

Investigate: What's the "unit" for optimizer cost estimates?

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • SQL
    • None
    • Performance

    Description

      Derby optimizer decisions are necessarily based on cost estimates. But what are "units" for these cost estimates? There is logic in OptimizerImpl.getNextPermutation() that treats cost estimates as if their unit is milliseconds--but is that really the case?

      The answer to that question may in fact be "Yes, the units are milliseconds"--and maybe the unexpected cost estimates that are sometimes seen are really caused by something else (ex. DERBY-1905). But if that's the case, it would be great to look at the optimizer costing code (see esp. FromBaseTable.estimateCost()) to verify that all of the "magic" of costing really makes sense given that the underlying unit is supposed to be milliseconds.

      Also, if the stats/cost estimate calculations are truly meant to be in terms of milliseconds, I can't help but wonder on what machine/criteria the determination of milliseconds is based. Is it time to update the stats for "modern" machines, or perhaps (shooting for the sky) to dynamically adjust the millisecond stats based on the machine that's running Derby and use the adjusted values somehow? I have no answers to these questions, but I think it would be great if someone out there was inclined to discuss/investigate these kinds of questions a bit more...

      Attachments

        Activity

          People

            Unassigned Unassigned
            army A B
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: