Re: performance regression, 7.2.3 -> 7.3b5 w/ VIEW - Mailing list pgsql-hackers

From Ross J. Reedstrom
Subject Re: performance regression, 7.2.3 -> 7.3b5 w/ VIEW
Date
Msg-id 20021113152011.GE22656@wallace.ece.rice.edu
Whole thread Raw
In response to Re: performance regression, 7.2.3 -> 7.3b5 w/ VIEW  (Tommi Maekitalo <t.maekitalo@epgmbh.de>)
List pgsql-hackers
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);


pgsql-hackers by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: performance regression, 7.2.3 -> 7.3b5 w/ VIEW
Next
From: Tom Lane
Date:
Subject: Re: pg_dump in 7.4