-(defun make-ustats ()
- (with-sql-connection (conn)
- (ignore-errors (sql-execute "drop table USTATS" conn))
- (sql-execute "create table USTATS (NAME varchar(160), COUNT bigint, SRL integer)" conn)
-
- (dotimes (srl 5)
- (insert-ustats-count conn "Concept Count" "MRCONSO" "distinct CUI" "KCUILRL" srl)
- (insert-ustats-count conn "Term Count" "MRCONSO" "distinct KCUILUI" "KCUILRL" srl)
- (insert-ustats-count conn "Distinct Term Count" "MRCONSO" "distinct LUI" "KLUILRL" srl)
- (insert-ustats-count conn "String Count" "MRCONSO" "*" "KSUILRL" srl)
- (insert-ustats-count conn "Distinct String Count" "MRCONSO" "distinct SUI" "KSUILRL" srl)
- (insert-ustats-count conn "Hierarchcy" "MRHIER" "*" "KSRL" srl)
- (insert-ustats-count conn "Mappings" "MRMAP" "*" "KSRL" srl)
- (insert-ustats-count conn "Simple Mappings" "MRSMAP" "*" "KSRL" srl)
- (insert-ustats-count conn "Co-occuring Concept Count" "MRCOC" "*" "KLRL" srl)
- (insert-ustats-count conn "Definition Count" "MRDEF" "*" "KSRL" srl)
- (insert-ustats-count conn "Rank Count" "MRRANK" "*" "KSRL" srl)
- (insert-ustats-count conn "Relationship Count" "MRREL" "*" "KSRL" srl)
- (insert-ustats-count conn "Semantic Type Count" "MRSTY" "*" "KLRL" srl)
- (insert-ustats-count conn "Simple Attribute Count" "MRSAT" "*" "KSRL" srl)
- (insert-ustats-count conn "Source Abbreviation Count" "MRSAB" "*" "SRL" srl)
- (insert-ustats-count conn "Word Index Count" "MRXW_ENG" "*" "KLRL" srl)
- (insert-ustats-count conn "Normalized Word Index Count" "MRXNW_ENG" "*" "KLRL" srl)
- (insert-ustats-count conn "Normalized String Index Count" "MRXNS_ENG" "*" "KLRL" srl))
- (sql-execute "create index USTATS_SRL on USTATS (SRL)" conn))
- (find-ustats-all))
-
-(defun insert-ustats-count (conn name table count-variable srl-control srl)
- (insert-ustats conn name (find-count-table conn table srl count-variable srl-control) srl))
-