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

Add primary key to catalog_inputs

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • PDB 6.7.3
    • PDB 6.13.0
    • PuppetDB
    • None
    • Hide

      The catalog_inputs table has a primary key.

      Show
      The catalog_inputs table has a primary key.
    • PuppetDB
    • 2
    • Enhancement
    • Some additional indexing has been added to the catalog inputs storage which should improve query performance in some cases.
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support