| From: | Tommi Maekitalo <t(dot)maekitalo(at)epgmbh(dot)de> |
|---|---|
| To: | "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>, Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: performance regression, 7.2.3 -> 7.3b5 w/ VIEW |
| Date: | 2002-11-13 08:28:38 |
| Message-ID: | 200211130928.38199.t.maekitalo@epgmbh.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Am Mittwoch, 13. November 2002 07:22 schrieb Ross J. Reedstrom:
> Hey Hackers -
...
>
> CREATE VIEW current_modules AS
> SELECT * FROM modules m
> WHERE module_ident =
> (SELECT max(module_ident) FROM modules
> WHERE m.moduleid = moduleid GROUP BY moduleid);
>
...
I just wonder if you really need the GROUP BY. The subselect should return
exactly one row and so max does without GROUP BY:
CREATE VIEW current_modules AS
SELECT * FROM modules m
WHERE module_ident =
(SELECT max(module_ident) FROM modules
WHERE m.moduleid = moduleid);
Tommi
--
Dr. Eckhardt + Partner GmbH
http://www.epgmbh.de
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Lee Kindness | 2002-11-13 09:29:58 | ecpg "problem" ... |
| Previous Message | Ross J. Reedstrom | 2002-11-13 08:02:38 | Re: performance regression, 7.2.3 -> 7.3b5 w/ VIEW |