Re: two queries and dual cpu (perplexed)

От: Jeff
Тема: Re: two queries and dual cpu (perplexed)
Дата: ,
Msg-id: ec08c6c467efe0132625ea1a80a20561@torgo.978.org
(см: обсуждение, исходный текст)
Ответ на: Re: two queries and dual cpu (perplexed)  ("Shoaib Burq (VPAC)")
Список: pgsql-performance

Скрыть дерево обсуждения

two queries and dual cpu (perplexed)  ("Shoaib Burq (VPAC)", )
 Re: two queries and dual cpu (perplexed)  (Jeff, )
  Re: two queries and dual cpu (perplexed)  (Gavin Sherry, )
  Re: two queries and dual cpu (perplexed)  ("Shoaib Burq (VPAC)", )
   Re: two queries and dual cpu (perplexed)  (Russell Smith, )
    Re: two queries and dual cpu (perplexed)  ("Shoaib Burq (VPAC)", )
     Re: two queries and dual cpu (perplexed)  (John A Meinel, )
      Re: two queries and dual cpu (perplexed)  ("Shoaib Burq (VPAC)", )
       Re: two queries and dual cpu (perplexed)  (Gavin Sherry, )
       Re: two queries and dual cpu (perplexed)  (Jeff, )
      Re: two queries and dual cpu (perplexed)  (Tom Lane, )
       Re: two queries and dual cpu (perplexed)  ("Shoaib Burq (VPAC)", )
        Re: two queries and dual cpu (perplexed)  (John A Meinel, )
   Re: two queries and dual cpu (perplexed)  ("Shoaib Burq (VPAC)", )
  Re: two queries and dual cpu (perplexed)  ("Shoaib Burq (VPAC)", )
  Re: two queries and dual cpu (perplexed)  (Kenneth Marshall, )
 Re: two queries and dual cpu (perplexed)  (Daniel Schuchardt, )
 Re: two queries and dual cpu (perplexed)  ("Dave Held", )

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 <>
http://www.jefftrout.com/
http://www.stuarthamm.net/



В списке pgsql-performance по дате сообщения:

От: Tom Lane
Дата:
Сообщение: Re: Index bloat problem?
От: "Joel Fradkin"
Дата:
Сообщение: Re: Joel's Performance Issues WAS : Opteron vs Xeon