pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Staubo <alex@bengler.no>
To: Kevin Grittner <kgrittn@ymail.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Bad query plan with high-cardinality column
Date: Fri, 22 Feb 2013 22:34:21 +0100
Message-ID: <D0D7098559DD470B9C2DE753E74B83E4@gmail.com> (raw)
In-Reply-To: <1361566076.10158.YahooMailNeo@web162905.mail.bf1.yahoo.com>
References: <19B2B4ECC4724A438200C54257BA8B20@gmail.com>
	<1361566076.10158.YahooMailNeo@web162905.mail.bf1.yahoo.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

On Friday, February 22, 2013 at 21:47 , Kevin Grittner wrote:
> I suspect you would be better off without those two indexes, and
> instead having an index on (conversation_id, created_at). Not just
> for the query you show, but in general.


Indeed, that solved it, thanks!
 


> In my experience these problems come largely from the planner not
> knowing the cost of dealing with each tuple. I see a lot less of
> this if I raise cpu_tuple_cost to something in the 0.03 to 0.05
> range.


Is this something I can just frob a bit without worrying about it adversely impacting database performance across the board, or should I be very careful and do lots of testing on a staging box first?


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (8+ messages)  latest in thread

Message-ID: <D0D7098559DD470B9C2DE753E74B83E4@gmail.com>
Permalink:  ../D0D7098559DD470B9C2DE753E74B83E4@gmail.com/
Also on:    postgresql.org/message-id/D0D7098559DD470B9C2DE753E74B83E4@gmail.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: alex@bengler.no, kgrittn@ymail.com
  Subject: Re: Bad query plan with high-cardinality column
  In-Reply-To: <D0D7098559DD470B9C2DE753E74B83E4@gmail.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