Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...


[mysqld]
local-infile=1
ft_stopword_file = ''
ft_min_word_len = 2
disable-log-bin
skip-log-bin
default-authentication-plugin=mysql_native_password
[mysql]
local-infile=1
[client]
local-infile=1
protocol=tcp
host=localhost
port=3306



















Select * from `component` `c` where
`c`.`effectiveTime`=(Select max(effectiveTime) from `component` where `id`=`c`.`id` and active=1)Select * from `component` `c`
where `c`.`effectiveTime`=(Select max(effectiveTime) from `component` where `id`=`c`.`id`)Select * from `component` `c`
where `c`.`active`=1
and `c`.`effectiveTime`=(Select max(effectiveTime) from `component` where `id`=`c`.`id`)
sudo chmod u+x bash/*
















select * from full_tableName tbl
where tbl.effectiveTime = (select max(sub.effectiveTime) from full_tableName sub
where sub.id = tbl.id);select * from full_tableName tbl
where tbl.effectiveTime = (select max(sub.effectiveTime) from full_tableName sub
where sub.id = tbl.id and sub.effectiveTime<='20190131');select * from tableName tbl
where tbl.effectiveTime = '20190731';select * from full_tableName tbl
where tbl.effectiveTime > '20190131' and tbl.effectiveTime <= '20190731' ;select * from full_tableName tbl
where tbl.effectiveTime > '20190131' and tbl.effectiveTime <= '20190731'
union
select * from full_tableName tbl
where tbl.effectiveTime = (select max(sub.effectiveTime) from full_tableName sub
where sub.id = tbl.id and sub.effectiveTime<='20190131')
and tbl.id IN (select id from full_tableName
where effectiveTime > '20190131' and effectiveTime <= '20190731')
order by id;CREATE VIEW snap_concept as (select * from full_concept tbl
where tbl.effectiveTime = (select max(sub.effectiveTime) from full_concept sub
where sub.id = tbl.id));CREATE VIEW snap20190131_concept as (select * from full_concept tbl
where tbl.effectiveTime = (select max(sub.effectiveTime) from full_concept sub
where sub.id = tbl.id and sub.effectiveTime<='20190131');select * from snap_concept where id in (3859001,3704008);select * from snap20190131_concept where id in (3859001,3704008);CREATE VIEW `snap1_concept` AS select `tbl`.`id` AS `id`,`tbl`.`effectiveTime` AS `effectiveTime`,`tbl`.`active` AS `active`,`tbl`.`moduleId` AS `moduleId`,`tbl`.`definitionStatusId` AS `definitionStatusId` from `full_concept` `tbl` where (`tbl`.`effectiveTime` = (select max(`sub`.`effectiveTime`) from (`full_concept` `sub` join `config_settings` `cfg`) where ((`sub`.`id` = `tbl`.`id`) and (`cfg`.`id` = 1) and (`sub`.`effectiveTime` <= `cfg`.`snapshotTime`))));CREATE VIEW `delta1_concept` AS select `tbl`.`id` AS `id`,`tbl`.`effectiveTime` AS `effectiveTime`,`tbl`.`active` AS `active`,`tbl`.`moduleId` AS `moduleId`,`tbl`.`definitionStatusId` AS `definitionStatusId` from (`full_concept` `tbl` join `config_settings` `cfg`) where ((`cfg`.`id` = 1) and (`tbl`.`effectiveTime` <= `cfg`.`deltaEndTime`) and (`tbl`.`effectiveTime` > `cfg`.`deltaStartTime`));SET SQL_SAFE_UPDATES=0;
update full_tableName tbl
set flag=flag | 1
where tbl.effectiveTime=(select max(sub.effectiveTime) from copy_full_tableName sub where sub.id=tbl.id and sub.effectiveTime<='20190731');
update full_tableName tbl
set flag=flag | 2
where tbl.effectiveTime=(select max(sub.effectiveTime) from copy_full_tableName sub where sub.id=tbl.id and sub.effectiveTime<='20190131');
update full_tableName tbl
set flag=flag | 4
where tbl.effectiveTime=(select max(sub.effectiveTime) from copy_full_tableName sub where sub.id=tbl.id and sub.effectiveTime<='20180731');
update full_tableName tbl
set flag=flag | 8
where tbl.effectiveTime=(select max(sub.effectiveTime) from copy_full_tableName sub where sub.id=tbl.id and sub.effectiveTime<='20180131');
SET SQL_SAFE_UPDATES=1;select * from full_tableName where flag & 2;-- Create temporary table for the supersededTime values
CREATE TEMPORARY TABLE tmp (id CHAR(36) NOT NULL,effectiveTime DATETIME,supersededTime DATETIME, PRIMARY KEY (id,effectiveTime));
-- Compute the supersededTime values for each combination of id+effectiveTime and add these to the temporary file
INSERT INTO tmp SELECT tbl.id, tbl.effectiveTime, (SELECT IFNULL(MIN(sub.effectiveTime),DATE "99991231") FROM full_tableName sub
WHERE tbl.id=sub.id AND tbl.effectiveTime<sub.effectiveTime) supersededTime FROM full_tableName tbl;
-- Apply the appropriate supersededTime values to each row in the full table
UPDATE full_tableName tbl
JOIN tmp
SET tbl.supersededTime=tmp.supersededTime
WHERE tmp.id=tbl.id AND tmp.effectiveTime=tbl.effectiveTime;-- This query assumes the default supersededTime is 9999-12-31
SELECT *
FROM full_tableName
WHERE supersededTime = DATE '99991231';-- This query assumes that [snapshotTime] is replaced by the required snapshotTime
SELECT *
FROM full_tableName
WHERE [snapshotTime] >= effectiveTime AND [snapshotTime] < supersededTime;select * from full_tableName tbl
where tbl.effectiveTime = (select max(sub.effectiveTime) from full_tableName sub
where sub.id = tbl.id and sub.active=1);select * from full_tableName tbl
where tbl.active=1 and tbl.effectiveTime = (select max(sub.effectiveTime) from full_tableName sub
where sub.id = tbl.id);


























call showConfig();call setLanguage(1,'en-GB');call setSnapshotTime(1,'2017-07-31');call setDeltaRange(1,'2016-07-31','2017-07-31');call resetConfig();call snap_termsInLanguages(p_conceptids,p_langCodes);p_conceptids'80146002,49438003'call snap_eclQuery('< 19829001 |disorder of lung|:116676008 |Associated morphology| = 40829002 |Acute edema|');p_snapshotTimep_langCodes'en-GB,en-US'DELIMITER ;
SELECT Now() `--`,"Create Database and Initialize" '--';
-- CREATE DATABASE
DROP DATABASE IF EXISTS `snomedct`;
CREATE DATABASE `snomedct` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `snomedct`;
-- INITIALIZE SETTINGS
SET GLOBAL net_write_timeout = 60;
SET GLOBAL net_read_timeout=120;
SET GLOBAL sql_mode ='';
SET SESSION sql_mode ='';DROP TABLE IF EXISTS `full_concept`;
CREATE TABLE `full_concept` (
`id` BIGINT NOT NULL DEFAULT 0,
`effectiveTime` DATETIME NOT NULL DEFAULT '2000-01-31 00:00:00',
`active` TINYINT NOT NULL DEFAULT 0,
`moduleId` BIGINT NOT NULL DEFAULT 0,
`definitionStatusId` BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`,`effectiveTime`))
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;DROP TABLE IF EXISTS `full_description`;
CREATE TABLE `full_description` (
`id` BIGINT NOT NULL DEFAULT 0,
`effectiveTime` DATETIME NOT NULL DEFAULT '2000-01-31 00:00:00',
`active` TINYINT NOT NULL DEFAULT 0,
`moduleId` BIGINT NOT NULL DEFAULT 0,
`conceptId` BIGINT NOT NULL DEFAULT 0,
`languageCode` VARCHAR (3) NOT NULL DEFAULT '',
`typeId` BIGINT NOT NULL DEFAULT 0,
`term` TEXT NOT NULL,
`caseSignificanceId` BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`,`effectiveTime`))
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;DROP TABLE IF EXISTS `full_relationship`;
CREATE TABLE `full_relationship` (
`id` BIGINT NOT NULL DEFAULT 0,
`effectiveTime` DATETIME NOT NULL DEFAULT '2000-01-31 00:00:00',
`active` TINYINT NOT NULL DEFAULT 0,
`moduleId` BIGINT NOT NULL DEFAULT 0,
`sourceId` BIGINT NOT NULL DEFAULT 0,
`destinationId` BIGINT NOT NULL DEFAULT 0,
`relationshipGroup` INT NOT NULL DEFAULT 0,
`typeId` BIGINT NOT NULL DEFAULT 0,
`characteristicTypeId` BIGINT NOT NULL DEFAULT 0,
`modifierId` BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`,`effectiveTime`))
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;DROP TABLE IF EXISTS `full_refset_Simple`;
CREATE TABLE `full_refset_Simple` (
`id` char(36) NOT NULL DEFAULT '',
`effectiveTime` DATETIME NOT NULL
DEFAULT '2000-01-31 00:00:00',
`active` TINYINT NOT NULL DEFAULT 0,
`moduleId` BIGINT NOT NULL DEFAULT 0,
`refsetId` BIGINT NOT NULL DEFAULT 0,
`referencedComponentId` BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`,`effectiveTime`))
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;DROP TABLE IF EXISTS `full_refset_Language`;
CREATE TABLE `full_refset_Language` (
`id` char(36) NOT NULL DEFAULT '',
`effectiveTime` DATETIME NOT NULL
DEFAULT '2000-01-31 00:00:00',
`active` TINYINT NOT NULL DEFAULT 0,
`moduleId` BIGINT NOT NULL DEFAULT 0,
`refsetId` BIGINT NOT NULL DEFAULT 0,
`referencedComponentId` BIGINT NOT NULL DEFAULT 0,
`acceptabilityId` BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`,`effectiveTime`))
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;DROP TABLE IF EXISTS `full_refset_ExtendedMap`;
CREATE TABLE `full_refset_ExtendedMap` (
`id` char(36) NOT NULL DEFAULT '',
`effectiveTime` DATETIME NOT NULL
DEFAULT '2000-01-31 00:00:00',
`active` TINYINT NOT NULL DEFAULT 0,
`moduleId` BIGINT NOT NULL DEFAULT 0,
`refsetId` BIGINT NOT NULL DEFAULT 0,
`referencedComponentId` BIGINT NOT NULL DEFAULT 0,
`mapGroup` INT NOT NULL DEFAULT 0,
`mapPriority` INT NOT NULL DEFAULT 0,
`mapRule` TEXT NOT NULL,
`mapAdvice` TEXT NOT NULL,
`mapTarget` VARCHAR (200) NOT NULL DEFAULT '',
`correlationId` BIGINT NOT NULL DEFAULT 0,
`mapCategoryId` BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`,`effectiveTime`))
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;DROP TABLE IF EXISTS `full_refset_ModuleDependency`;
CREATE TABLE `full_refset_ModuleDependency` (
`id` char(36) NOT NULL DEFAULT '',
`effectiveTime` DATETIME NOT NULL
DEFAULT '2000-01-31 00:00:00',
`active` TINYINT NOT NULL DEFAULT 0,
`moduleId` BIGINT NOT NULL DEFAULT 0,
`refsetId` BIGINT NOT NULL DEFAULT 0,
`referencedComponentId` BIGINT NOT NULL DEFAULT 0,
`sourceEffectiveTime` DATETIME NOT NULL
DEFAULT '2000-01-31 00:00:00',
`targetEffectiveTime` DATETIME NOT NULL
DEFAULT '2000-01-31 00:00:00',
PRIMARY KEY (`id`,`effectiveTime`))
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Terminology/sct2_Concept_Full_INT_[RELEASE-DATE].txt'
INTO TABLE `full_concept`
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`definitionStatusId`);LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Terminology/sct2_Description_Full-en_INT_[RELEASE-DATE].txt'
INTO TABLE `full_description`
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`conceptId`,`languageCode`,`typeId`,`term`,`caseSignificanceId`);LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Terminology/sct2_Relationship_Full_INT_[RELEASE-DATE].txt'
INTO TABLE `full_relationship`
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`sourceId`,`destinationId`,`relationshipGroup`,`typeId`,`characteristicTypeId`,`modifierId`);LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Refset/Content/der2_Refset_SimpleFull_INT_[RELEASE-DATE].txt'
INTO TABLE `full_refset_simple`
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`refSetId`,`referencedComponentId` );LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Refset/Language/der2_cRefset_LanguageFull-en_INT_$RELDATE.txt'
INTO TABLE `full_refset_Language`
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`refsetId`,`referencedComponentId`,`acceptabilityId`);LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Refset/Map/der2_iisssccRefset_ExtendedMapFull_INT_$RELDATE.txt'
INTO TABLE `full_refset_ExtendedMap`
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`refsetId`,`referencedComponentId`,`mapGroup`,`mapPriority`,`mapRule`,`mapAdvice`,`mapTarget`,`correlationId`,`mapCategoryId`);LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Snapshot/Terminology/sct2_Concept_Snapshot_INT_[RELEASE-DATE].txt'
INTO TABLE `snap_concept`
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`definitionStatusId`);LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Snapshot/Refset/Content/der2_Refset_SimpleSnapshot_INT_[RELEASE-DATE].txt'
INTO TABLE `snap_refset_simple`
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`refSetId`,`referencedComponentId`);CREATE VIEW `snap_{name}` AS
(SELECT `d`.* FROM `snap_description` `d`
JOIN `snap_refset_Language` `rs` ON `d`.`id` = `rs`.`referencedComponentId`
JOIN `config_settings` `cfg` ON `rs`.`refSetId` = `cfg`.`languageId`
WHERE `d`.`active` = 1 AND `d`.`typeId` {typeId}
AND `rs`.`active` = 1 AND `rs`.`acceptabilityId` {acceptabilityId}
AND `cfg`.`id`=0);Select conceptId,'FSN',id,term from snap_fsn where conceptId=95570007
UNION
Select conceptId,'Pref',id,term from snap_pref where conceptId=95570007
UNION
Select conceptId,'Syn',id,term from snap_syn where conceptId=95570007;CREATE VIEW `snap_syn_search_active` AS
(SELECT `d`.*,`rs`.`acceptabilityId` FROM `snap_description` `d`
JOIN `snap_refset_Language` `rs` ON `d`.`id` = `rs`.`referencedComponentId`
JOIN `snap_concept` `c` ON `c`.`id` = `d`.`conceptId`
JOIN `config_settings` `cfg` ON `rs`.`refSetId` = `cfg`.`languageId`
WHERE `d`.`active` = 1 AND `d`.`typeId` {typeId}
AND `rs`.`active` = 1
AND `c`.`active` = 1
AND `cfg`.`id`=0);SELECT `s`.`conceptId`,`s`.`term` 'matching term',`f`.`term` `FSN` FROM `snap_syn_search_active` `s`
JOIN `snap_fsn` `f` ON `f`.`conceptId`=`s`.`conceptId`
WHERE MATCH (`s`.`term`)
AGAINST ('+acute +anterior +myocardial +infarction -ecg -old -ekg' IN BOOLEAN MODE) ORDER BY length(`f`.`term`),length(`s`.`term`);-- Supertype Parent View
CREATE VIEW `snap_rel_parent_{termtype}` AS
SELECT `r`.`targetId` AS `id`, `d`.`term` AS `term`, `r`.`sourceId` AS `conceptId`
FROM `snap_relationship` `r` JOIN `snap_{termtype}` `d` ON `r`.`targetId` = `d`.`conceptId`
WHERE `r`.`active` = 1 AND `r`.`typeId` = 116680003;
-- Subtype Child View: Differences are `sourceId` changed to `targetId` and `targetId` changed to `sourceId` as shown below
CREATE VIEW `snap_rel_child_{termtype}` AS
SELECT `r`.`sourceId` AS `id`, `d`.`term` AS `term`, `r`.`destinationId` AS `conceptId`
FROM `snap_relationship` `r` JOIN `snap_{termtype}` `d` ON `r`.`sourceId` = `d`.`conceptId`
WHERE `r`.`active` = 1 AND `r`.`typeId` = 116680003;Select "Concept", conceptid, term from snap_pref where conceptId=6025007
UNION
Select "Supertype Parent", id, term from snap_rel_parent_pref where conceptId=6025007
UNION
Select "Subtype Child", id, term from snap_rel_child_pref where conceptId=6025007;snap_tc_ancestor_fsnsnap_tc_ancestor_pref-- Supertype Ancestor View: Differences are `sourceId` changed to `targetId` and `targetId` changed to `sourceId` as shown below
CREATE VIEW `snap_tc_ancestor_{termtype}` AS
(SELECT `r`.`supertypeId` `id`,`d`.`term` `term`,`r`.`subtypeId` `conceptId`
FROM `snap_transclose` `r`
JOIN `snap_{termtype}` `d` ON (`r`.`supertypeId` = `d`.`conceptId`));
--- Subtype Descendant View
CREATE VIEW `snap_tc_descendant_{termtype}` AS
(SELECT `r`.`subtypeId` `id`,`d`.`term` `term`,`r`.`supertypeId` `conceptId`
FROM `snap_transclose` `r`
JOIN `snap_{termtype}` `d` ON (`r`.`subtypeId` = `d`.`conceptId`));Select "Concept", conceptid, term from snap_pref where conceptId=16001004
UNION
Select "Ancestor", id, term from snap_tc_ancestor_pref where conceptId=16001004
UNION
Select "Descendant", id, term from snap_tc_descendant_pref where conceptId=16001004;-- Proximal primitive parents of a specified concept
CREATE VIEW `snap_pp_parent_{viewtype}` AS
(SELECT `r`.`supertypeId` `id`,`d`.`term` `term`,`r`.`subtypeId` `conceptId`
FROM `snap_proximal_primitives` `r`
JOIN `snap_{viewtype}` `d` ON (`r`.`supertypeId` = `d`.`conceptId`));
-- Concepts with a specified proximal primitive parent concept
CREATE VIEW `snap_pp_child_{viewtype}` AS
(SELECT `r`.`subtypeId` `id`,`d`.`term` `term`,`r`.`supertypeId` `conceptId`
FROM `snap_proximal_primitives` `r`
JOIN `snap_{viewtype}` `d` ON (`r`.`subtypeId` = `d`.`conceptId`));--
Select "Concept", conceptid, term from snap_pref where conceptId=21522001
UNION
Select "Proximal Primitive Parent", id, term from snap_pp_parent_pref where conceptId=21522001;Select "Concept", conceptid, term from snap_pref where conceptId=22253000
UNION
Select "Concept with PP-Parent: 21522001|Pain|", id, term from snap_pp_child_pref where conceptId=22253000;CREATE VIEW `snap_rel_def_{viewtype}` AS
(SELECT `r`.`sourceId` `sourceId`,`src`.`Term` `sourceTerm`,`r`.`typeId` `typeId`,`typ`.`Term` `typeTerm`,`r`.`destinationId` `destinationId`,`dest`.`Term` `destinationTerm`,`r`.`relationshipGroup` `relationshipGroup`
FROM (((`snap_relationship` `r`
JOIN `snap_{viewtype}` `src` ON ((`r`.`sourceId` = `src`.`conceptId`))) JOIN `snap_{viewtype}` `typ` ON ((`r`.`typeId` = `typ`.`conceptId`))) JOIN `snap_{viewtype}` `dest` ON ((`r`.`destinationId` = `dest`.`conceptId`))) WHERE ((`r`.`active` = 1) AND (`r`.`characteristicTypeId` = 900000000000011006)));Select * from snap_rel_def_pref where sourceId=6025007;CREATE VIEW delta_inactive_concepts AS
select `c`.`id`, `c`.`effectiveTime`, `c`.`active`, `c`.`definitionStatusId`, `cf`.`term` 'FSN',
`vp`.`term` 'reason', `arp`.`term` 'assoc_type', `atf`.`id` 'ref_conceptId', `atf`.`term` 'ref_concept_FSN'
from `delta_concept` `c`
left join `snap_fsn` `cf` ON `cf`.`conceptid`=`c`.`id`
left outer join `snap_refset_attributevalue` `v` on `v`.`referencedComponentId`=`c`.`id`
and `v`.`refsetId`=900000000000489007 and `v`.`active`=1
left outer join `snap_pref` `vp` on `vp`.`conceptid`=`v`.`valueid`
left outer join `snap_refset_association` `a` on `a`.`referencedComponentId`=`c`.`id` and `a`.`refsetId` IN
(900000000000528000, 900000000000523009, 900000000000527005, 900000000000526001,
900000000000525002, 900000000000531004, 900000000000524003, 900000000000530003) and `a`.`active`=1
left outer join `snap_pref` `arp` on `arp`.`conceptid`=`a`.`refsetId`
left outer join `snap_fsn` `atf` on `atf`.`conceptid`=`a`.`targetComponentId`
where `c`.`active`=0
order by `c`.`id`;SELECT * FROM delta_inactive_concepts;CREATE VIEW delta_inactive_descriptions AS
select `d`.`id`, `d`.`effectiveTime`, `d`.`active`, `d`.`conceptid`, `d`.`term` 'term',
`df`.`term` 'concept_fsn', `c`.`active` 'concept_active' ,`vp`.`term` 'reason'
from `delta_description` `d`
left outer join `snap_fsn` `df` ON `df`.`conceptid`=`d`.`conceptid`
join `snap_concept` `c` ON `c`.`id`=`d`.`conceptid`
left outer join `snap_refset_attributevalue` `v` on `v`.`referencedComponentId`=`d`.`id`
and `v`.`refsetId`=900000000000490003 and `v`.`active`=1
left outer join `snap_pref` `vp` on `vp`.`conceptid`=`v`.`valueid`
where `d`.`active`=0
order by `d`.`id`;SELECT * FROM delta_inactive_descriptions;snap_tc_descendant_fsnsnap_tc_descendant_pref