Re: [PERFORM] Help optimize view

2007-08-20 Thread Relyea, Mike
> From: Kevin Grittner [mailto:[EMAIL PROTECTED] > > First off, let's make sure we're optimizing the query you > really want to run. > AND binds tighter than OR, so as you have it written, it is > the same as: > > HAVING "PrintSamples"."MachineID" = 4741 > OR ( "PrintSamples"."Mach

Re: [PERFORM] Help optimize view

2007-08-18 Thread Kevin Grittner
>>> On Fri, Aug 10, 2007 at 11:57 AM, in message <[EMAIL PROTECTED]>, "Relyea, Mike" <[EMAIL PROTECTED]> wrote: > HAVING "PrintSamples"."MachineID" = 4741 OR "PrintSamples"."MachineID" = > 4745 AND . . . On top of the issue in my prior email, I don't see any test for 4745 in the EXPLAIN ANALYZE

Re: [PERFORM] Help optimize view

2007-08-18 Thread Kevin Grittner
>>> On Fri, Aug 10, 2007 at 11:57 AM, in message <[EMAIL PROTECTED]>, "Relyea, Mike" <[EMAIL PROTECTED]> wrote: > I'm have the following view as part of a larger, aggregate query that is > running slower than I'd like. > . . . > HAVING "PrintSamples"."MachineID" = 4741 OR "PrintSamples"."MachineID

[PERFORM] Help optimize view

2007-08-17 Thread Relyea, Mike
I'm have the following view as part of a larger, aggregate query that is running slower than I'd like. There are 4 views total, each very similar to this one. Each of the views is then left joined with data from some other tables to give me the final result that I'm looking for. I'm hoping that

Re: [PERFORM] Help optimize view

2007-08-13 Thread Kevin Grittner
>>> On Mon, Aug 13, 2007 at 4:25 PM, in message <[EMAIL PROTECTED]>, "Kevin Grittner" <[EMAIL PROTECTED]> wrote: On Mon, Aug 13, 2007 at 4:00 PM, in message > <[EMAIL PROTECTED]>, "Relyea, > Mike" <[EMAIL PROTECTED]> wrote: > >> From what Tom >> says, it sounds like if I want the data re

Re: [PERFORM] Help optimize view

2007-08-13 Thread Kevin Grittner
>>> On Mon, Aug 13, 2007 at 4:00 PM, in message <[EMAIL PROTECTED]>, "Relyea, Mike" <[EMAIL PROTECTED]> wrote: > > Re-writing the view like this maybe bought me something. > Tough to tell because I also increased some of the statistics. I don't know whether it was the finer-grained statistics

Re: [PERFORM] Help optimize view

2007-08-13 Thread Relyea, Mike
> >>> On Mon, Aug 13, 2007 at 1:48 PM, in message > <[EMAIL PROTECTED] > .net>, "Relyea, Mike" <[EMAIL PROTECTED]> wrote: > > I've increased shared_buffers to 128MB, and restarted the > server. My > > total run time didn't really change. > > Please forgive me if this guess doesn't help eithe

Re: [PERFORM] Help optimize view

2007-08-13 Thread Tom Lane
"Relyea, Mike" <[EMAIL PROTECTED]> writes: > I've increased shared_buffers to 128MB, and restarted the server. My > total run time didn't really change. It doesn't look like you can hope for much in terms of improving the plan. The bulk of the time is going into scanning ParameterValues and Meas

Re: [PERFORM] Help optimize view

2007-08-13 Thread Kevin Grittner
>>> On Mon, Aug 13, 2007 at 1:48 PM, in message <[EMAIL PROTECTED]>, "Relyea, Mike" <[EMAIL PROTECTED]> wrote: > I've increased shared_buffers to 128MB, and restarted the server. My > total run time didn't really change. Please forgive me if this guess doesn't help either, but could you try e

Re: [PERFORM] Help optimize view

2007-08-13 Thread Relyea, Mike
> >>> On Mon, Aug 13, 2007 at 10:35 AM, in message > <[EMAIL PROTECTED] > .net>, "Relyea, Mike" <[EMAIL PROTECTED]> wrote: > > I'm running 8.2.4 on Windows XP with 1.5 GB memory. > > shared_buffers = 12288 > > effective_cache_size = 1 > > For starters, you might want to adjust one or both of

Re: [PERFORM] Help optimize view

2007-08-13 Thread Kevin Grittner
>>> On Mon, Aug 13, 2007 at 10:35 AM, in message <[EMAIL PROTECTED]>, "Relyea, Mike" <[EMAIL PROTECTED]> wrote: > I'm running 8.2.4 on Windows XP with 1.5 GB memory. > shared_buffers = 12288 > effective_cache_size = 1 For starters, you might want to adjust one or both of these. It looks to

Re: [PERFORM] Help optimize view

2007-08-13 Thread Relyea, Mike
> -Original Message- > From: Tom Lane [mailto:[EMAIL PROTECTED] > Sent: Friday, August 10, 2007 5:44 PM > To: Relyea, Mike > Cc: pgsql-performance@postgresql.org > Subject: Re: [PERFORM] Help optimize view > > Try increasing join_collapse_limit --- you have ju

Re: [PERFORM] Help optimize view

2007-08-10 Thread Tom Lane
"Relyea, Mike" <[EMAIL PROTECTED]> writes: > SELECT "PrintSamples"."MachineID", "PrintSamples"."PrintCopyID", > "tblColors"."ColorID", avg("ParameterValues"."ParameterValue") AS > "Mottle_NMF" >FROM "AnalysisModules" >JOIN ("tblColors" >JOIN ("tblTPNamesAndColors" >JOIN "PrintSample

Re: [PERFORM] Help optimize view

2007-08-10 Thread Relyea, Mike
Oops. Realized I posted the wrong SQL and EXPLAIN ANALYZE results. Also forgot to mention that my "server" has 1.5 GB memory. SELECT "PrintSamples"."MachineID", "PrintSamples"."PrintCopyID", "tblColors"."ColorID", avg("ParameterValues"."ParameterValue") AS "Mottle_NMF" FROM "AnalysisModules"