Re: speed of querry? - Mailing list pgsql-performance

From Tom Lane
Subject Re: speed of querry?
Date
Msg-id 8324.1113604689@sss.pgh.pa.us
Whole thread Raw
In response to Re: speed of querry?  ("Joel Fradkin" <jfradkin@wazagua.com>)
List pgsql-performance
"Joel Fradkin" <jfradkin@wazagua.com> writes:
> Turning off merg joins seems to of done it but what do I need to do so I am
> not telling the system explicitly not to use them, I must be missing some
> setting?

> "  ->  Hash Left Join  (cost=185.57..226218.77 rows=177236 width=75) (actual
> time=21.147..2221.098 rows=177041 loops=1)"
> "        Hash Cond: (("outer".jobtitleid = "inner".id) AND
> (("outer".clientnum)::text = ("inner".clientnum)::text))"

It's overestimating the cost of this join for some reason ... and I
think I see why.  It's not accounting for the combined effect of the
two hash clauses, only for the "better" one.  What are the statistics
for tbljobtitle.id and tbljobtitle.clientnum --- how many distinct
values of each, and are the distributions skewed to a few popular values?

            regards, tom lane

pgsql-performance by date:

Previous
From: Rod Taylor
Date:
Subject: Re: Spend 7K *WHERE*? WAS Intel SRCS16 SATA raid? and How
Next
From: Ron Mayer
Date:
Subject: Re: Spend 7K *WHERE*? WAS Intel SRCS16 SATA raid? and How