Skip site navigation (1) Skip section navigation (2)

Re: Nested Loop

From: "Dave Dutcher" <dave(at)tridecap(dot)com>
To: "'Gauri Kanekar'" <meetgaurikanekar(at)gmail(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Nested Loop
Date: 2007-03-26 15:38:12
Message-ID: 004101c76fbc$c439b700$ (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
-----Original Message-----
>From: pgsql-performance-owner(at)postgresql(dot)org On Behalf Of Gauri Kanekar
>Subject: Re: [PERFORM] Nested Loop
>join_collapse_limit = 1                 # JOINs 

Is there a reason you have this set to 1?  Postgres can't consider multiple
join orders when you do that.  I would try setting that back to the default
and seeing if this query is any faster.

Other than that it looked like the problems with the query might be bad
estimates of rows.  One is that postgres expects there to be 1 matching row
from rd when there are actually 30.  You might try increasing the statistics
targets on and rd.sdt, reanalyzing, and seeing if that helps.  Also
postgres expects the join of rd and rm to return about 27205 rows when it
actually returns 10 million.  I'm not sure what you can do about that.
Maybe if Postgres gets a better estimate for rd it would then estimate the
join better.


In response to

pgsql-performance by date

Next:From: RagnarDate: 2007-03-26 16:22:33
Subject: Re: Nested Loop
Previous:From: Gauri KanekarDate: 2007-03-26 15:03:34
Subject: Re: Nested Loop

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group