The cdm_cache is defined as:
CREATE TABLE ${ohdsiSchema}.cdm_cache
(
id int8 NOT NULL DEFAULT nextval('${ohdsiSchema}.cdm_cache_seq'),
concept_id int4 NOT NULL,
source_id int4 NOT NULL,
record_count int8 NULL,
descendant_record_count int8 NULL,
person_count int8 NULL,
descendant_person_count int8 NULL,
CONSTRAINT cdm_cache_pk PRIMARY KEY (id),
CONSTRAINT cdm_cache_un UNIQUE (concept_id, source_id),
CONSTRAINT cdm_cache_fk FOREIGN KEY (source_id) REFERENCES ${ohdsiSchema}.source (source_id) ON DELETE CASCADE
);
This stores record counts, by source_id. It was found that it’s quicker to query record counts by concept ID from the webAPI db instead of querying out to MMP platforms (redshift, netezza, spark, etc), so these records are copied here after they are requested.
achilles_cache is defined as:
CREATE TABLE ${ohdsiSchema}.achilles_cache
(
id bigint NOT NULL DEFAULT nextval('${ohdsiSchema}.achilles_cache_seq'),
source_id int4 NOT NULL,
cache_name varchar NOT NULL,
cache text,
CONSTRAINT achilles_cache_pk PRIMARY KEY (id),
CONSTRAINT achilles_cache_fk FOREIGN KEY (source_id) REFERENCES ${ohdsiSchema}."source" (source_id) ON DELETE CASCADE
);
Tis table caches a JSON (in the text field) report data for the achilles reports. After building the report data from the cdm source, it will cache those results as JSON in this table.