pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Mario Splivalo <msplival@jagor.srce.hr>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: Lot'sa joins - performance tip-up, please?
Date: Wed, 10 May 2006 17:10:48 -0500
Message-ID: <20060510221048.GX99570@pervasive.com> (raw)
In-Reply-To: <1146753957.8538.30.camel@localhost.localdomain>
References: <1146533274.14006.11.camel@localhost.localdomain>
	<17793.1146679117@sss.pgh.pa.us>
	<1146753957.8538.30.camel@localhost.localdomain>

On Thu, May 04, 2006 at 04:45:57PM +0200, Mario Splivalo wrote:
Well, here's the problem...

>          ->  Nested Loop  (cost=0.00..176144.30 rows=57925 width=26)
> (actual time=1074.984..992536.243 rows=57925 loops=1)
>                ->  Seq Scan on ticketing_codes_played
> (cost=0.00..863.25 rows=57925 width=8) (actual time=74.479..2047.993
> rows=57925 loops=1)
>                ->  Index Scan using ticketing_codes_pk on
> ticketing_codes  (cost=0.00..3.01 rows=1 width=18) (actual
> time=17.044..17.052 rows=1 loops=57925)
>                      Index Cond: (ticketing_codes.code_id =
> "outer".code_id)

Anyone have any idea why on earth it's doing that instead of a hash or
merge join?

In any case, try swapping the order of ticketing_codes_played and
ticketing_codes. Actually, that'd probably make it worse.

Try SET enable_nestloop = off;
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (8+ messages)  latest in thread

Message-ID: <20060510221048.GX99570@pervasive.com>
Permalink:  ../20060510221048.GX99570@pervasive.com/
Also on:    postgresql.org/message-id/20060510221048.GX99570@pervasive.com

 · 

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: jnasby@pervasive.com, msplival@jagor.srce.hr, tgl@sss.pgh.pa.us
  Subject: Re: Lot'sa joins - performance tip-up, please?
  In-Reply-To: <20060510221048.GX99570@pervasive.com>

* 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