Re: - Mailing list pgsql-performance

From Tom Lane
Subject Re:
Date
Msg-id 25081.1173146092@sss.pgh.pa.us
Whole thread Raw
In response to  (Jeff Cole <cole.jeff@gmail.com>)
Responses Re:  (Jeff Cole <cole.jeff@gmail.com>)
List pgsql-performance
Jeff Cole <cole.jeff@gmail.com> writes:
> Hi, I'm new to tuning PostgreSQL and I have a query that gets slower
> after I run a vacuum analyze.  I believe it uses a Hash Join before
> the analyze and a Nested Loop IN Join after.  It seems the Nested
> Loop IN Join estimates the correct number of rows, but underestimates
> the amount of time required.   I am curious why the vacuum analyze
> makes it slower and if that gives any clues as too which parameter I
> should be tuning.

Hm, the cost for the upper nestloop is way less than you would expect
given that the HASH IN join is going to have to be repeated 100+ times.
I think this must be due to a very low "join_in_selectivity" estimate
but I'm not sure why you are getting that, especially seeing that the
rowcount estimates aren't far off.  Can you show us the pg_stats
rows for symptoms.id and symptom_reports.symptom_id?

            regards, tom lane

pgsql-performance by date:

Previous
From: "Steinar H. Gunderson"
Date:
Subject: Re: Opinions on Raid
Next
From: Guido Neitzer
Date:
Subject: Re: strange performance regression between 7.4 and 8.1