Re: Help with tuning this query (with explain analyze finally)

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Ken Egervari" <ken(at)upfactor(dot)com>
Cc: Ragnar Hafstað <gnari(at)simnet(dot)is>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Help with tuning this query (with explain analyze finally)
Date: 2005-03-03 05:52:13
Message-ID: 200503022152.13211.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32 pgsql-performance

Ken,

>         ->  Merge Join  (cost=602.54..1882.73 rows=870 width=91) (actual
> time=234.000..312.000 rows=310 loops=1)
>               Merge Cond: ("outer".current_status_id = "inner".id)

Hmmm ... this merge join appears to be the majority of your execution
time .... at least within the resolution that PGWin allows us. Please try
two things, and give us Explain Analyzes:

1) To determine your query order ala Dan Tow and drive off of person, please
SET JOIN_COLLAPSE_LIMIT = 1 and then run Mark Kirkwood's version of the
query. (Not that I believe in Dan Tow ... see previous message ... but it
would be interesting to see the results.

2) Force PG to drop the merge join via SET ENABLE_MERGEJOIN = FALSE;

Also, please let us know some about the server you're using and your
configuration parameters, particularly:
shared_buffers
work_mem
effective_cache_size
random_page_cost

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Ken Egervari 2005-03-03 06:35:42 Re: Help with tuning this query (more musings)
Previous Message Josh Berkus 2005-03-03 05:36:23 Re: Help with tuning this query

Browse pgsql-performance by date

  From Date Subject
Next Message Ken Egervari 2005-03-03 06:35:42 Re: Help with tuning this query (more musings)
Previous Message Josh Berkus 2005-03-03 05:36:23 Re: Help with tuning this query