Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 3AD27B5DC1A for ; Mon, 3 Oct 2011 14:49:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 82347-07-2 for ; Mon, 3 Oct 2011 17:49:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-yw0-f46.google.com (mail-yw0-f46.google.com [209.85.213.46]) by mail.postgresql.org (Postfix) with ESMTP id B9304B5DC0C for ; Mon, 3 Oct 2011 14:49:07 -0300 (ADT) Received: by ywb5 with SMTP id 5so3659949ywb.19 for ; Mon, 03 Oct 2011 10:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:subject:date:organization:message-id:mime-version :content-type:x-mailer:thread-index:content-language; bh=8tPH4DlJKbBbAJS8kFC5UmuRgsmwhzolWN5majyMCkY=; b=VGbcmyCzk63zosaVOqog1LrMJkBr1Yy23Oe/0uP/zrVoYEzDRUVoXQYF+AN82YIgiX fhb+nLXHaLMv7Ht5THY8+Lkl0rQwhFWyPw9oJzAO/gijEchsMvm8WKJWn76FE3nq47ZY 9rNAwJ9FC+BpKIYaCa6he09Y0yMXwa+fCz4FA= Received: by 10.100.174.10 with SMTP id w10mr206903ane.55.1317664147412; Mon, 03 Oct 2011 10:49:07 -0700 (PDT) Received: from CristianTK ([190.104.157.91]) by mx.google.com with ESMTPS id r16sm18054852ani.9.2011.10.03.10.48.32 (version=SSLv3 cipher=OTHER); Mon, 03 Oct 2011 10:48:34 -0700 (PDT) From: "Soporte @ TEKSOL S.A." To: Subject: pkey is not used on productive database Date: Mon, 3 Oct 2011 14:48:10 -0300 Organization: TEKSOL S.A. Message-ID: <014c01cc81f4$a774e140$f65ea3c0$@teksol.com.ar> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_014D_01CC81DB.822893A0" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AcyB9J1/CUQwdiyrQ9if7ybNpyZcHw== Content-Language: es-ar X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.757 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_SBL=0.141 X-Spam-Level: X-Archive-Number: 201110/38 X-Sequence-Number: 45260 This is a multipart message in MIME format. ------=_NextPart_000_014D_01CC81DB.822893A0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit 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 ------=_NextPart_000_014D_01CC81DB.822893A0 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

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

 

------=_NextPart_000_014D_01CC81DB.822893A0--