pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Soporte @ TEKSOL S.A. <soporte@teksol.com.ar>
Cc: pgsql-performance@postgresql.org
Subject: Re: pkey is not used on productive database
Date: Tue, 4 Oct 2011 14:55:36 +0200
Message-ID: <20111004125536.GA21733@depesz.com> (raw)
In-Reply-To: <014c01cc81f4$a774e140$f65ea3c0$@teksol.com.ar>
References: <014c01cc81f4$a774e140$f65ea3c0$@teksol.com.ar>

On Mon, Oct 03, 2011 at 02:48:10PM -0300, Soporte @ TEKSOL S.A. wrote:
> Hi, 
> 
>  
> 
> I need help to understand the issue on a productive database for a select
> that takes more time than expected.
> 
>  
> 
> 1-      On a development database I ran the query (select) and I can see on
> Explain Analyze pgAdmin use all the indexes and primary keys defined. Dev db
> has almost 10% of productive data.
> 
> 2-      On productive database the same query on Explain Analyze from
> pgAdmin shows a diferent planning, not using a pkey index and instead uses
> the progressive scan on a million of rows. I can see Primary key is defined
> for the table on pgAdmin.
> 
>  
> 
> What could be the issue on a productive for not use the pkey index for the
> SELECT?

general answer:
http://www.depesz.com/index.php/2010/09/09/why-is-my-index-not-being-used/

but for more details, we'd need to see the query and \d of the table.

Best regards,

depesz

-- 
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/



view thread (3+ messages)  latest in thread

Message-ID: <20111004125536.GA21733@depesz.com>
Permalink:  ../20111004125536.GA21733@depesz.com/
Also on:    postgresql.org/message-id/20111004125536.GA21733@depesz.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: depesz@depesz.com, soporte@teksol.com.ar
  Subject: Re: pkey is not used on productive database
  In-Reply-To: <20111004125536.GA21733@depesz.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