pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joel Fradkin <jfradkin@wazagua.com>
Cc: 'Dave Held' <dave.held@arrayservicesgrp.com>
Cc: 'PERFORM' <pgsql-performance@postgresql.org>
Subject: Re: speed of querry?
Date: Fri, 15 Apr 2005 18:38:09 -0400
Message-ID: <8324.1113604689@sss.pgh.pa.us> (raw)
In-Reply-To: <000001c541e7$133f3f10$797ba8c0@jfradkin>
References: <000001c541e7$133f3f10$797ba8c0@jfradkin>

"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



view thread (22+ messages)  latest in thread

Message-ID: <8324.1113604689@sss.pgh.pa.us>
Permalink:  ../8324.1113604689@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8324.1113604689@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, jfradkin@wazagua.com, dave.held@arrayservicesgrp.com
  Subject: Re: speed of querry?
  In-Reply-To: <8324.1113604689@sss.pgh.pa.us>

* 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