Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.7.12
-
None
-
None
-
PostgreSQL
Description
The postgres totalnum script takes a very long time to run because a self-join on an ontology table with a LIKE clause on c_fullname takes ages. The same query on MSSQL with the same tables and same indices takes <5s.
select distinct p1.c_fullname, p2.c_basecode
from dimCountOnt p1
inner join dimCountOnt p2
on p2.c_fullname like p1.c_fullname||'%' escape '#'
where p2.c_fullname like '\i2b2\Diagnoses\%' escape '#'
and p1.c_fullname like '\\i2b2\\Diagnoses\\%'
Using specialized postgres indices did not help:
create index dimCountOntA on dimCountOnt using spgist (c_fullname);
CREATE INDEX dimCountOntB ON dimCountOnt(c_fullname text_pattern_ops);
CREATE INDEX dimCountOntBjk ON dimCountOnt USING btree(c_fullname varchar_pattern_ops);
select distinct p1.c_fullname, p2.c_basecode
from dimCountOnt p1
inner join dimCountOnt p2
on p2.c_fullname like p1.c_fullname||'%' escape '#'
where p2.c_fullname like '\i2b2\Diagnoses\%' escape '#'
and p1.c_fullname like '\\i2b2\\Diagnoses\\%'
Using specialized postgres indices did not help:
create index dimCountOntA on dimCountOnt using spgist (c_fullname);
CREATE INDEX dimCountOntB ON dimCountOnt(c_fullname text_pattern_ops);
CREATE INDEX dimCountOntBjk ON dimCountOnt USING btree(c_fullname varchar_pattern_ops);
Attachments
Issue Links
- related to
-
CORE-343 Provide totalnum counting scripts
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 1.7.13 [ 11002 ] |
Affects Version/s | 1.7.12 [ 11000 ] |
Assignee | Jeffrey Klann [ jklann ] |
Fix Version/s | 1.7.12 [ 10901 ] | |
Fix Version/s | 1.7.13 [ 11002 ] | |
Key |
|
|
Affects Version/s | 1.7.12 [ 10901 ] | |
Affects Version/s | 1.7.12 [ 11000 ] | |
Workflow | Web Client Issues Workflow [ 12106 ] | i2b2 Issues Workflow [ 12108 ] |
Project | i2b2 Web Client [ 10033 ] | i2b2 Core Software [ 10034 ] |
Status | New [ 10000 ] | Open [ 1 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Ready to Test [ 10001 ] |
Assignee | Jeffrey Klann [ jklann ] | Reeta Metta [ rm302 ] |
Status | Ready to Test [ 10001 ] | Testing [ 10002 ] |
Fix Version/s | 1.7.13 [ 10902 ] | |
Fix Version/s | 1.7.12 [ 10901 ] |
Fix Version/s | 1.7.12 [ 10901 ] | |
Fix Version/s | 1.7.13 [ 10902 ] |
Fix Version/s | 1.7.13 [ 10902 ] | |
Fix Version/s | 1.7.12 [ 10901 ] |
Assignee | Reeta Metta [ rm302 ] | Jeffrey Klann [ jklann ] |
Status | Testing [ 10002 ] | Reopened [ 4 ] |
Resolution | Fixed [ 1 ] | |
Status | Reopened [ 4 ] | Resolved [ 5 ] |
Fix Version/s | 1.7.12 [ 10901 ] | |
Fix Version/s | 1.7.13 [ 10902 ] |
Status | Resolved [ 5 ] | Closed [ 6 ] |