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

Use hint to overide skip scan/range scan determination

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Resolution: Fixed
    • None
    • None
    • None
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tonyhuang tonyhuang
            jamestaylor James R. Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment