Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-291

Use hint to overide skip scan/range scan determination

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • old issue number:
      160

      Description

      We currently always use a skip scan filter when we can. There are cases in which performance is better if a range scan would have been used. We should allow the user to specify a hint in the query to override this decision.

      The same is true of a range scan. There are time when we don't have a filter for the leading PK column, but do have one for the second PK column. In this case currently, a skip scan won't be done. However, depending on the cardinality of the first column, it would be better to do a skip scan.

      The SelectStatement already has a hintNode that is passed through the grammar. Let's introduce a couple of simple hints:

      SELECT /*+ range_scan */
      and
      SELECT /*+ skip_scan */

      These could be used to override the default behavior. These hints will not be as necessary once we have stats, but aren't a bad idea to have even then, since the table stats may get out of date too.

        Attachments

          Activity

            People

            • Assignee:
              tonyhuang tonyhuang
              Reporter:
              jamestaylor James Taylor
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: