From: Joshua D. Drake <jd@commandprompt.com>
To: Ogden <lists@darkstatic.com>
Cc: Jesper Krogh <jesper@krogh.cc>
Cc: Kenneth Marshall <ktm@rice.edu>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query much faster with enable_seqscan=0
Date: Tue, 21 Sep 2010 12:07:11 -0700
Message-ID: <1285096031.15919.68.camel@jd-desktop.unknown.charter.com> (raw)
In-Reply-To: <3062DF4E-7460-4487-818A-BF77F176E501@darkstatic.com>
References: <0D5B9ED0-00C3-4EEB-8336-0B2F8A884620@darkstatic.com>
<20100921180618.GI17152@aart.is.rice.edu>
<D707045F-C689-403A-9729-8DBCC39F53A1@darkstatic.com>
<4C98FEA2.8030607@krogh.cc>
<3062DF4E-7460-4487-818A-BF77F176E501@darkstatic.com>
On Tue, 2010-09-21 at 14:02 -0500, Ogden wrote:
> How odd, I set the following:
>
> seq_page_cost = 1.0
> random_page_cost = 2.0
>
> And now the query runs in milliseconds as opposed to 14 seconds. Could this really be the change? I am running ANALYZE now - how often is it recommended to do this?
PostgreSQL's defaults are based on extremely small and some would say
(non production) size databases. As a matter of course I always
recommend bringing seq_page_cost and random_page_cost more in line.
However, you may want to try moving random_page_cost back to 4 and try
increasing cpu_tuple_cost instead.
Sincerely,
Joshua D. Drake
--
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579
Consulting, Training, Support, Custom Development, Engineering
http://twitter.com/cmdpromptinc | http://identi.ca/commandprompt
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: jd@commandprompt.com, lists@darkstatic.com, jesper@krogh.cc, ktm@rice.edu
Subject: Re: Query much faster with enable_seqscan=0
In-Reply-To: <1285096031.15919.68.camel@jd-desktop.unknown.charter.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