Thanks @Chris_Knoll,
This is the results we got when quering the table:
postgres=# select count(*) from webapi.cdm_cache;
count
-------
100
(1 row)
postgres=# select count(*) from webapi.cdm_cache where record_count = 0 and descendant_record_count = 0 and person_count = 0 and descendant_person_count = 0;
count
-------
100
(1 row)
postgres=# select * from webapi.cdm_cache order by id desc limit 5;
id | concept_id | source_id | record_count | descendant_record_count | person_count | descendant_person_count
-----+------------+-----------+--------------+-------------------------+--------------+-------------------------
100 | 9202 | 6 | 0 | 0 | 0 | 0
99 | 8949 | 6 | 0 | 0 | 0 | 0
98 | 8947 | 6 | 0 | 0 | 0 | 0
97 | 8941 | 6 | 0 | 0 | 0 | 0
96 | 38003620 | 6 | 0 | 0 | 0 | 0
(5 rows)
postgres=# \d webapi.cdm_cache
Table "webapi.cdm_cache"
Column | Type | Collation | Nullable | Default
-------------------------+---------+-----------+----------+-------------------------------------------
id | bigint | | not null | nextval('webapi.cdm_cache_seq'::regclass)
concept_id | integer | | not null |
source_id | integer | | not null |
record_count | bigint | | |
descendant_record_count | bigint | | |
person_count | bigint | | |
descendant_person_count | bigint | | |
Indexes:
"cdm_cache_pk" PRIMARY KEY, btree (id)
"cdm_cache_concept_id_idx" btree (concept_id, source_id)
"cdm_cache_un" UNIQUE CONSTRAINT, btree (concept_id, source_id)
Foreign-key constraints:
"cdm_cache_fk" FOREIGN KEY (source_id) REFERENCES webapi.source(source_id) ON DELETE CASCADE
Truncaitng the table gives
postgres=# truncate webapi.cdm_cache;
TRUNCATE TABLE
postgres=# select count(*) from webapi.cdm_cache;
count
-------
0
(1 row)
Will update when we have a resolution. Thanks for your help!