You're right, I should remove that (cruft left over from when the
subselect wasn't). However, it has no impact on the planner at hand:
removing it does trim 25% from the execution time, but getting the
WHERE clauses used in the right order gains an order of magnitude.

Both apply. Thanks, I'll fix it.

Ross

On Wed, Nov 13, 2002 at 09:28:38AM +0100, Tommi Maekitalo wrote:
> 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);

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to