pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Steinar H. Gunderson <sgunderson@bigfoot.com>
Cc: Pepe Barbe <elventear@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Join performance
Date: Thu, 08 Nov 2007 19:15:04 -0500
Message-ID: <24997.1194567304@sss.pgh.pa.us> (raw)
In-Reply-To: <20071108225120.GA22963@uio.no>
References: <2ACEBABD-7853-475B-B8C0-91B654AF143D@gmail.com>
	<20071108225120.GA22963@uio.no>

"Steinar H. Gunderson" <sgunderson@bigfoot.com> writes:
> On Thu, Nov 08, 2007 at 04:47:09PM -0600, Pepe Barbe wrote:
>> I am having an issue on PostgreSQL 8.0.12. In the past we had performance 
>> issues with the query planner for queries on some tables where we knew we 
>> had indexes and it was doing a sequential scan, and for this reason we 
>> issue "SET enable_seqscan = FALSE" for some queries.

> This is a bad idea in general.

Indeed.  A less brute-force way of getting the planner to favor
indexscans is to reduce random_page_cost ... have you experimented
with that?

Also, consider updating to 8.2.x, which has an improved cost model
for indexscans and will more often make the correct choice without
such shenanigans.

			regards, tom lane



view thread (7+ messages)  latest in thread

Message-ID: <24997.1194567304@sss.pgh.pa.us>
Permalink:  ../24997.1194567304@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24997.1194567304@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, sgunderson@bigfoot.com, elventear@gmail.com
  Subject: Re: Join performance
  In-Reply-To: <24997.1194567304@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