From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christo Du Preez <christo@mecola.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: test / live environment, major performance difference
Date: Tue, 12 Jun 2007 14:42:57 -0400
Message-ID: <21855.1181673777@sss.pgh.pa.us> (raw)
In-Reply-To: <466EDD7C.5090807@mecola.com>
References: <466EA078.20601@mecola.com>
<8385.1181664586@sss.pgh.pa.us>
<466ED0E4.3040803@mecola.com>
<19136.1181669869@sss.pgh.pa.us>
<466EDD7C.5090807@mecola.com>
Christo Du Preez <christo@mecola.com> writes:
> Fast:
> "public";"layertype";"parentid";0.98797;4;2;"{4,1}";"{0.00902256,0.00300752}";"";-0.142857
> Slow:
> "public";"layertype";"parentid";0.00745157;4;7;"{300}";"{0.976155}";"{1,1,4,5,8,12}";0.92262
Well, those statistics are almost completely different, and what the
slow one says is that parentid = 300 accounts for 97% of the table.
So that's why you get different plans. If that is not reflective of
reality, then you have not ANALYZEd the table lately.
Maybe it's a pilot-error problem, like not doing the ANALYZE as a user
with sufficient privileges? IIRC you have to be table owner, database
owner, or superuser to ANALYZE.
regards, tom lane
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: tgl@sss.pgh.pa.us, christo@mecola.com
Subject: Re: test / live environment, major performance difference
In-Reply-To: <21855.1181673777@sss.pgh.pa.us>
* 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