pgAdmin崩溃查询

时间:2016-11-17 01:01:24

标签: sql postgresql psql pgadmin

我正在尝试在列出的表/物化视图上执行以下SQL:

SELECT e.subject_id, e.hadm_id, e.icustay_id, e.itemid, e.charttime, e.value, e.valuenum
FROM MIMICIII.chartevents as e
INNER JOIN MIMICIII.adults_with_sepsis as aas1
ON aas1.subject_id = e.subject_id
INNER JOIN MIMICIII.adults_with_sepsis as aas2
ON aas2.hadm_id = e.hadm_id

然而,运行约一分钟后,pgAdmin崩溃(窗口错误:pgAdmin已停止响应)。我认为这个问题与pgAdmin如何存储章程存在有关:Chart Events Structure

我希望我能在chartevents上执行连接,然后它会加入所有的chartevents表。由于这是不正确的,我应该如何进行此连接?

同样,我已经提供了如何在下面形成承租人的代码。

表:

                                  Table "mimiciii.chartevents_2"
    Column    |              Type              | Modifiers | Storage  | Stats target | Description
--------------+--------------------------------+-----------+----------+--------------+-------------
 row_id       | integer                        | not null  | plain    |              |
 subject_id   | integer                        | not null  | plain    |              |
 hadm_id      | integer                        |           | plain    |              |
 icustay_id   | integer                        |           | plain    |              |
 itemid       | integer                        |           | plain    |              |
 charttime    | timestamp(0) without time zone |           | plain    |              |
 storetime    | timestamp(0) without time zone |           | plain    |              |
 cgid         | integer                        |           | plain    |              |
 value        | character varying(255)         |           | extended |              |
 valuenum     | double precision               |           | plain    |              |
 valueuom     | character varying(50)          |           | extended |              |
 warning      | integer                        |           | plain    |              |
 error        | integer                        |           | plain    |              |
 resultstatus | character varying(50)          |           | extended |              |
 stopped      | character varying(50)          |           | extended |  

        |

物化视图:

                   Materialized view "mimiciii.adults_with_sepsis"
         Column         |  Type   | Modifiers | Storage | Stats target | Description
tion                                                                            -----
------------------------+---------+-----------+---------+--------------+-------------
 subject_id             | integer |           | plain   |              |
 hadm_id                | integer |           | plain   |              |
 infection              | integer |           | plain   |              |
 explicit_severe_sepsis | integer |           | plain   |              |
 explicit_septic_shock  | integer |           | plain   |              |
 organ_dysfunction      | integer |           | plain   |              |
 mech_vent              | integer |           | plain   |              |
 angus                  | integer |           | plain   |              |

图表事件代码:

--------------------------------------------------------
--  DDL for Table CHARTEVENTS
--------------------------------------------------------

DROP TABLE IF EXISTS CHARTEVENTS CASCADE;
CREATE TABLE CHARTEVENTS
   (    ROW_ID INT NOT NULL,
    SUBJECT_ID INT NOT NULL,
    HADM_ID INT,
    ICUSTAY_ID INT,
    ITEMID INT,
    CHARTTIME TIMESTAMP(0),
    STORETIME TIMESTAMP(0),
    CGID INT,
    VALUE VARCHAR(255),
    VALUENUM DOUBLE PRECISION,
    VALUEUOM VARCHAR(50),
    WARNING INT,
    ERROR INT,
    RESULTSTATUS VARCHAR(50),
    STOPPED VARCHAR(50),
    CONSTRAINT chartevents_rowid_pk PRIMARY KEY (ROW_ID)
  );

0 个答案:

没有答案