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

ORDER BY on salted table yields incorrect ordering

    XMLWordPrintableJSON

    Details

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

      Description

      From Xavier Jodoin (xjodoin at gmail.com) on the mailing list:
      When I do this query on a salt table my results aren't well sort it seem to be sorted only by salt bucket

      SELECT * FROM xawik_log_visit AS log_visit WHERE idsite = 529920360 AND visit_last_action_time >= TO_DATE('2013-09-25 22:00:00') ORDER BY visit_last_action_time DESC LIMIT 10

      The query plan of my query
      ------------

      PLAN

      ------------

      CLIENT PARALLEL 60-WAY SKIP SCAN ON 20 RANGES OVER XAWIK_LOG_VISIT 0...19,529920360,(*'2013-09
      SERVER TOP 10 ROWS SORTED BY [VISIT_LAST_ACTION_TIME]
      CLIENT MERGE SORT

      And my table definition

      CREATE TABLE xawik_log_visit (
      idsite UNSIGNED_INT not null,
      visit_last_action_time date not null,
      idvisit UNSIGNED_INT not null,
      idvisitor UNSIGNED_INT not null,
      visit_first_action_time date,
      txid BIGINT CONSTRAINT pk PRIMARY KEY (idsite, visit_last_action_time desc, idvisit ) ) SALT_BUCKETS = 20;

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: