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

Fact Updating appears slower with Fact Reduplication

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PDB 4.4.0
    • Fix Version/s: PDB 4.4.1
    • Component/s: None
    • Labels:
      None
    • Template:
    • Method Found:
      Customer Feedback
    • QA Risk Assessment:
      Needs Assessment

      Description

      The Problem

      I'm seeing an increase in time to update the facts table in PE 2017.2.1.

      See, https://explain.depesz.com/s/GG28

      I'm also see a large increase in log messages where queries on the facts table are making temporary files.

      2017-06-01 13:04:53.254 CDT [db:pe-puppetdb,sess:59305624.1a9d,pid:6813,vtid:16/146,tid:0] LOG:  temporary file: path "pg_tblspc/16384/PG_9.4_201409291/pgsql_tmp/pgsql_tmp6813.3", size 45768
      2017-06-01 13:04:53.254 CDT [db:pe-puppetdb,sess:59305624.1a9d,pid:6813,vtid:16/146,tid:0] STATEMENT:  select    path, id, value_type_id, large_value_hash,    case when large_value_hash is null               and value_type_id = 5           then value    end as value,    case when large_value_hash is null then value_string    end as value_string,    value_integer, value_float, value_boolean  from facts as f  inner join fact_paths fp on f.fact_path_id = fp.id  where f.factset_id = $1
      

      That query has a plan like this:

      https://explain.depesz.com/s/Zsc

      Suggested Solution

      I believe both of these plans can be improved with the following index.

      CREATE INDEX facts_factset_id_fact_path_id_idx ON facts(factset_id, fact_path_id)

      Pull Request

      https://github.com/puppetlabs/puppetdb/pull/2307

        Attachments

          Activity

            People

            • Assignee:
              russell.mull Russell Mull
              Reporter:
              nick.walker Nick Walker
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support