Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13376

Primary index can be created with fields sequence differ from declared.

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.6, 2.8.1
    • Fix Version/s: 2.9
    • Component/s: sql
    • Labels:
      None
    • Release Note:
      fix an issue when primary key was created with invalid fields order
    • Ignite Flags:
      Release Notes Required

      Description

      Steps to reproduce:

      Execute the following DDL (create table + create index):

      CREATE TABLE IF NOT EXISTS Workspace (
          id UUID NOT NULL,
          accountId UUID NOT NULL,
          jsonModel VARCHAR,
          PRIMARY KEY (accountId, id)
        ) WITH "template=partitioned,atomicity=transactional,key_type=org.gridgain.gmc.dto.workspace.WorkspaceKey,value_type=workspace.Workspace,cache_name=WorkspaceCache";
      
      CREATE INDEX IF NOT EXISTS workspace_id_account_id_idx ON Workspace (id, accountId);
      

      On node start got the following warning:

      Index with the given set or subset of columns already exists (consider dropping either new or existing index) [cacheName=WorkspaceCache, schemaName=PUBLIC, tableName=WORKSPACE, newIndexName=WORKSPACE_ID_ACCOUNT_ID_IDX, existingIndexName=_key_PK, existingIndexColumns=[ID, ACCOUNTID]]
      

      But PK and index have different order!

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                zstan Stanilovsky Evgeny
                Reporter:
                zstan Stanilovsky Evgeny
                Reviewer:
                Taras Ledkov
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m