From: | "Dann Corbit" <DCorbit(at)connx(dot)com> |
---|---|
To: | <pgsql-hackers(at)postgresql(dot)org> |
Subject: | I feel the need for speed. What am I doing wrong? |
Date: | 2003-01-07 00:21:30 |
Message-ID: | D90A5A6C612A39408103E6ECDD77B8294CD786@voyager.corporate.connx.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
I have a query using two postgres tables.
One is called "CNX_DS_53_SIS_STU_OPT_FEE_TB" and the other is called
"CNX_DS2_53_SIS_STU_OPT_FEE_TB".
I am getting 3 times slower performance than Microsoft Access when
performing a left outer join.
Here are the tables in question:
connxdatasync=# \d "CNX_DS_53_SIS_STU_OPT_FEE_TB"
Table "CNX_DS_53_SIS_STU_OPT_FEE_TB"
Attribute | Type | Modifier
----------------+---------------+----------
RT_REC_KEY | character(14) |
cnxarraycolumn | integer |
CRC | bigint | not null
connxdatasync=# \d "CNX_DS2_53_SIS_STU_OPT_FEE_TB"
Table "CNX_DS2_53_SIS_STU_OPT_FEE_TB"
Attribute | Type | Modifier
----------------+---------------+----------
RT_REC_KEY | character(14) |
cnxarraycolumn | integer |
CRC | bigint | not null
Here is the query:
select a."RT_REC_KEY", a."cnxarraycolumn", a."CRC" from
"CNX_DS_53_SIS_STU_OPT_FEE_TB" a left outer join
"CNX_DS2_53_SIS_STU_OPT_FEE_TB" b on ( a."RT_REC_KEY" = b."RT_REC_KEY"
and a."cnxarraycolumn" = b."cnxarraycolumn") where b.oid is null ;
Creating the following index had no effect on performance!
create unique index i1 on "CNX_DS2_53_SIS_STU_OPT_FEE_TB" ("RT_REC_KEY",
"cnxarraycolumn", "CRC");
Both tables had 6139062 rows of data.
In this query ... all rows of data match perfectly, so no results are
returned.
Is there a way to reformulate this query so that it will use the index?
From | Date | Subject | |
---|---|---|---|
Next Message | Marc G. Fournier | 2003-01-07 00:24:48 | Re: [GENERAL] www.postgresql.org |
Previous Message | Doug McNaught | 2003-01-07 00:18:32 | Re: Dropping fields |
From | Date | Subject | |
---|---|---|---|
Next Message | Marc G. Fournier | 2003-01-07 00:27:03 | Re: New Portal in Place, DNS switched ... |
Previous Message | Tom Lane | 2003-01-07 00:15:22 | Re: Read-only transactions |