Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-4881

Add primary key to catalog_inputs

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PDB 6.7.3
    • Fix Version/s: PDB 6.12.1
    • Component/s: None
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      Hide

      The catalog_inputs table has a primary key.

      Show
      The catalog_inputs table has a primary key.
    • Story Points:
      2
    • Release Notes:
      Enhancement
    • Release Notes Summary:
      Some additional indexing has been added to the catalog inputs storage which should improve query performance in some cases.
    • QA Risk Assessment:
      Needs Assessment

      Description

      When scoping this feature we specifically omitted any work to optimize storage/queries in order to limit the first round work. By doing this we also omitted a primary key, which means the table cannot be cleaned up by pg_repack. We should add a primary key to the table.

      I believe this would work as a primary key.

      ALTER TABLE catalog_inputs ADD CONSTRAINT catalog_inputs_pkey PRIMARY KEY (type, name, certname_id);
      

      If we allow customers to add it ahead of time as a workaround, we'll need to preface the ADD CONSTRAINT command in the migration with the below command to drop the primary key because ADD CONSTRAINT doesn't support IF NOT EXISTS.

      ALTER TABLE catalog_inputs DROP CONSTRAINT IF EXISTS catalog_inputs_pkey;
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              austin.blatt Austin Blatt
              Reporter:
              austin.blatt Austin Blatt
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support