From: | Josh Berkus <josh(at)agliodbs(dot)com> |
---|---|
To: | Hugo Ferreira <bytter(at)gmail(dot)com> |
Cc: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: Help trying to tune query that executes 40x slower than in SqlServer |
Date: | 2005-03-07 17:28:47 |
Message-ID: | 200503070928.47118.josh@agliodbs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Hugo,
> insert into MRS_REPLICATION_OUT select 514, 10000168, C.contxt_id,
> C.contxt_elmt_ix, CAST(null as NUMERIC(18)), CAST(null as
> NUMERIC(18)), CAST(null as NUMERIC(18)), CAST(null as NUMERIC(18)),
> CAST(null as NUMERIC(18)), null, 1 from c2iedm.CONTXT as P inner join
> c2iedm.CONTXT_ELMT as C on (P.contxt_id=C.contxt_id) inner join
> MRS_REPLICATION_OUT as S on S.ent_id=10000029 and (CAST(P.contxt_id AS
> numeric(18)) = S.pk1) inner join MRS_TRANSACTION TRANS on
Can you *format* this query please, and re-submit it? Proper query format
looks like:
SELECT a.1, b.2
FROM a JOIN b ON a.1 = b.3
JOIN c ON b.4 = c.1
WHERE a.5 < 6
AND c.7 = '2005-01-01';
... for maximum readability.
Also, when asking others to help debug your queries, it helps them (and,
frankly, you) if you can NOT use single-letter table aliases. Single-letter
table aliases are evil for the same reason that single-letter variables in
code are.
Thanks!
--
Josh Berkus
Aglio Database Solutions
San Francisco
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2005-03-07 17:31:06 | Re: Tuning, configuration for 7.3.5 on a Sun E4500 |
Previous Message | John A Meinel | 2005-03-07 17:24:07 | Re: [PERFORM] Help with tuning this query (with |