pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pkey is not used on productive database
3+ messages / 3 participants
[nested] [flat]

* pkey is not used on productive database
@ 2011-10-03 17:48  Soporte @ TEKSOL S.A. <soporte@teksol.com.ar>
  0 siblings, 2 replies; 3+ messages in thread

From: Soporte @ TEKSOL S.A. @ 2011-10-03 17:48 UTC (permalink / raw)
  To: pgsql-performance

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?

 

Cristian C. Bittel

 

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pkey is not used on productive database
@ 2011-10-04 12:55  hubert depesz lubaczewski <depesz@depesz.com>
  parent: Soporte @ TEKSOL S.A. <soporte@teksol.com.ar>
  1 sibling, 0 replies; 3+ messages in thread

From: hubert depesz lubaczewski @ 2011-10-04 12:55 UTC (permalink / raw)
  To: Soporte @ TEKSOL S.A. <soporte@teksol.com.ar>; +Cc: pgsql-performance

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/



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pkey is not used on productive database
@ 2011-10-04 13:01  Scott Marlowe <scott.marlowe@gmail.com>
  parent: Soporte @ TEKSOL S.A. <soporte@teksol.com.ar>
  1 sibling, 0 replies; 3+ messages in thread

From: Scott Marlowe @ 2011-10-04 13:01 UTC (permalink / raw)
  To: Soporte @ TEKSOL S.A. <soporte@teksol.com.ar>; +Cc: pgsql-performance

On Mon, Oct 3, 2011 at 11:48 AM, Soporte @ TEKSOL S.A.
<soporte@teksol.com.ar> 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?

Please post the schema, query and explain analyze output of the runs
on both machines.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2011-10-04 13:01 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-10-03 17:48 pkey is not used on productive database Soporte @ TEKSOL S.A. <soporte@teksol.com.ar>
2011-10-04 12:55 ` hubert depesz lubaczewski <depesz@depesz.com>
2011-10-04 13:01 ` Scott Marlowe <scott.marlowe@gmail.com>

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