Skip to content

Duplicate values for one resource in xx_resource_token_refs #3763

Closed
@punktilious

Description

Describe the bug
The xx_resource_token_refs table contains duplicate entries. Although this doesn't impact the results of FHIR search interactions, it does lead to increased storage costs:

fhirdb=> select parameter_name_id, common_token_value_id, logical_resource_id, composite_id from fhirdata.patient_resource_token_refs where
parameter_name_id = 20423 and logical_resource_id = 458590;
 parameter_name_id | common_token_value_id | logical_resource_id | composite_id 
-------------------+-----------------------+---------------------+--------------
             20423 |                   886 |              458590 |             
             20423 |                   886 |              458590 |             

The same is true for xx_str_values.

Parameter tables are heavily indexed, so having duplicates here is significant.

Environment
Which version of IBM FHIR Server? 5.0.0

To Reproduce

  1. Build a fresh schema
  2. Run the system integration test suite
  3. Query the database and look for parameter tables with duplicate entries

Expected behavior
Parameter tables should not have duplicates. Note, some parameter values may be stored more than once if there are composites involved, but a parameter value should not be stored more than once where composite_id is null.

Additional context
N/A

Metadata

Assignees

Labels

P1Priority 1 - Must HavebugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions