Re: Performance of full outer join in 8.3

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Christian Schröder <cs(at)deriva(dot)de>
Cc: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Performance of full outer join in 8.3
Date: 2009-04-15 12:25:40
Message-ID: 1239798340.23905.21.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


On Wed, 2009-04-15 at 14:04 +0200, Christian Schröder wrote:
> Grzegorz Jaśkiewicz wrote:
> > set work_mem=24000; before running the query.
> >
> > postgres is doing merge and sort on disc, that's always slow.
> >
> Ok, but why is the plan different in 8.2? As you can see the same query
> is really fast in 8.2, but slow in 8.3.

The cost of the query seems accurate, so the absence of
attachment_isins_attachment_idx on the 8.3 plan looks to be the reason.
There's no way it would choose to scan 8115133 rows on the pkey if the
other index was available and usable.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message SongDongyan 2009-04-15 12:30:29 a question about postgresql server connection
Previous Message Grzegorz Jaśkiewicz 2009-04-15 12:11:44 Re: Performance of full outer join in 8.3

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-04-15 12:27:34 Re: Replacing plpgsql's lexer
Previous Message Grzegorz Jaśkiewicz 2009-04-15 12:11:44 Re: Performance of full outer join in 8.3