pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff <threshar@torgo.978.org>
To: Shoaib Burq (VPAC) <sab@vpac.org>
Cc: performance pgsql <pgsql-performance@postgresql.org>
Subject: Re: two queries and dual cpu (perplexed)
Date: Fri, 22 Apr 2005 07:48:29 -0400
Message-ID: <ec08c6c467efe0132625ea1a80a20561@torgo.978.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0504221328410.14851-200000@hp.vpac.org>
References: <Pine.LNX.4.44.0504221328410.14851-200000@hp.vpac.org>


On Apr 21, 2005, at 11:33 PM, Shoaib Burq (VPAC) wrote:

>
> BTW I guess should mention that I am doing the select count(*) on a 
> View.
>

A bit of a silly question...
but are you actually selecting all the rows from this query in 
production or would it be more selective?  ie select * from bigslowview 
where bah = 'snort'?


> Ran the Explain analyse with the nestedloop disabled but it was taking
> forever... and killed it after 30mins.
>

If it takes too long you can run just plain explain (no analyze) and it 
will show you the plan.  This is nearly always instant... it'll give 
you a clue as to if your setting changes did anything.

You may need to end up breaking some parts of this up into subqueries.  
I've had to do this before.  I had one query that just ran too dang 
slow as a join so I modified it into a subquery type deal.  Worked 
great.  However since you are selecting ALL rows I doubt that will help 
much.

Another option may be to use materialized views.  Not sure how 
"dynamic" your data model is. It could help.

--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/




view thread (18+ messages)  latest in thread

Message-ID: <ec08c6c467efe0132625ea1a80a20561@torgo.978.org>
Permalink:  ../ec08c6c467efe0132625ea1a80a20561@torgo.978.org/
Also on:    postgresql.org/message-id/ec08c6c467efe0132625ea1a80a20561@torgo.978.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: threshar@torgo.978.org, sab@vpac.org
  Subject: Re: two queries and dual cpu (perplexed)
  In-Reply-To: <ec08c6c467efe0132625ea1a80a20561@torgo.978.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox