[PDB-1224] Move fact path reference from the fact_values table to the facts table Created: 2015/02/10  Updated: 2015/05/05  Resolved: 2015/03/30

Status: Closed
Project: PuppetDB
Component/s: None
Affects Version/s: None
Fix Version/s: PDB 2.3.1

Type: Bug Priority: Normal
Reporter: Ryan Senior Assignee: Rob Browning
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PDB-1225 Update fact storage and querying to u... Closed
relates to PDB-1226 Create GC code for disassociated fact... Closed
relates to PDB-1227 Test new table structure and fact pat... Closed
relates to PDB-1031 ERROR: update or delete on table "fac... Closed
Template:
Story Points: 1
Sprint: PuppetDB 2015-02-25, PuppetDB 2015-03-11, PuppetDB 2015-03-25, PuppetDB 2015-04-08
QA Contact: Kurt Wall

 Description   

Although our current table structure is more efficient from a space perspective, it's more costly to query. We should create a migration that drops the fact path id from the fact_values table and instead have the facts table point at both the fact value and the fact path along with the factset. A quick first pass at this migration will allow the fact diffing logic to be updated in parallel. Care needs to be taken that we do this migration efficiently and quickly as it will be adding a new (populated, non-null) column on a table that is potentially very large.


QA Risk Assessment

Probability Low (re-arranging internals)
Impact Medium (limited, not catastrophic)
Risk Level Low
Test Level Unit


 Comments   
Comment by Rob Browning [ 2015/02/17 ]

Tested several approaches and settled on creating a migration facts table explicitly from scratch for now. We just drop the dead columns from the other tables since that should be quite cheap with postgresql.

Current version of the code should be here:

https://github.com/rbrw/puppetdb/tree/ticket/stable/pdb-1224-lift-fact-paths-into-facts

and the original master version:

https://github.com/rbrw/puppetdb/compare/ticket/master/pdb-1224-lift-fact-paths-into-facts

Note that this code will break puppetdb until PDB-1225 is ready, and it hasn't been tested yet against HSQLDB.

Generated at Sat Dec 14 02:51:50 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.