FHIR icon indicating copy to clipboard operation
FHIR copied to clipboard

the row counts in db size report contain negative values

Open PrasannaHegde1 opened this issue 2 years ago • 1 comments

Describe the bug The schema tool DB size report contains some strange negative values(-159) for row counts.

Environment Which version of IBM FHIR Server? 5.0.0-SNAPSHOT

To Reproduce Steps to reproduce the behavior:

java -jar ${WORKSPACE}/fhir-persistence-schema/target/fhir-persistence-schema-*-cli.jar \
  --db-type postgresql \
  --prop-file postgres.properties \
  --schema-name a-schema-name \
  --show-db-size

result : 
Summary by Resource Type
------------------------
                  PractitionerRole  Resources/Versions:        -1/       -1 All Rows:       286 Table Bytes:       139264 [ 0.3%] Index Bytes:       442368 [ 0.8%]
                      Practitioner  Resources/Versions:        -1/       -1 All Rows:       584 Table Bytes:       163840 [ 0.3%] Index Bytes:       532480 [ 1.0%]
                      Organization  Resources/Versions:        -1/       -1 All Rows:       395 Table Bytes:       147456 [ 0.3%] Index Bytes:       516096 [ 1.0%]
                          Resource  Resources/Versions:         0/      113 All Rows:       657 Table Bytes:       212992 [ 0.4%] Index Bytes:       401408 [ 0.8%]
                          Location  Resources/Versions:        -1/       -1 All Rows:       341 Table Bytes:       155648 [ 0.3%] Index Bytes:       548864 [ 1.0%]

Summary by Parameter Table Type
-------------------------------
           SYSTEM_STRING  Rows:        -1 Table:         8192 [ 0.0%] Index:        32768 [ 0.1%]
                LOCATION  Rows:      -159 Table:         8192 [ 0.0%] Index:      5242880 [10.0%]
                  NUMBER  Rows:      -159 Table:            0 [ 0.0%] Index:      2605056 [ 5.0%]
              SYSTEM_TAG  Rows:       114 Table:         8192 [ 0.0%] Index:        32768 [ 0.1%]
                QUANTITY  Rows:      -159 Table:         8192 [ 0.0%] Index:      7864320 [15.0%]
         SYSTEM_SECURITY  Rows:        -1 Table:            0 [ 0.0%] Index:        16384 [ 0.0%]
             SYSTEM_DATE  Rows:        -1 Table:            0 [ 0.0%] Index:        24576 [ 0.0%]
                    DATE  Rows:      -159 Table:        16384 [ 0.0%] Index:      3956736 [ 7.6%]
                 PROFILE  Rows:      -159 Table:        49152 [ 0.1%] Index:      2703360 [ 5.2%]
                SECURITY  Rows:      -159 Table:            0 [ 0.0%] Index:      2605056 [ 5.0%]
               REFERENCE  Rows:      -159 Table:        40960 [ 0.1%] Index:      2686976 [ 5.1%]
            SYSTEM_TOKEN  Rows:        -1 Table:         8192 [ 0.0%] Index:        32768 [ 0.1%]
                  STRING  Rows:       870 Table:      1466368 [ 2.8%] Index:      5586944 [10.7%]
          SYSTEM_PROFILE  Rows:        55 Table:         8192 [ 0.0%] Index:        32768 [ 0.1%]
                     TAG  Rows:      -159 Table:        65536 [ 0.1%] Index:      2736128 [ 5.2%]
                    LIST  Rows:        -1 Table:         8192 [ 0.0%] Index:         8192 [ 0.0%]
                   TOKEN  Rows:       466 Table:       106496 [ 0.2%] Index:      2777088 [ 5.3%]

Expected behavior expected 0s, -1 or a positive number.

PrasannaHegde1 avatar Aug 11 '22 17:08 PrasannaHegde1

We saw this when using our ibm-fhir-server helm chart to deploy fhir-server and postgres to a kubernetes cluster, then ran the tool against the db (using the admin user).

lmsurpre avatar Sep 06 '22 12:09 lmsurpre