pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dirk.Lutzebaeck@t-online.de
To: Greg Stark <gsstark@mit.edu>
Cc: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us
Cc: john@arbash-meinel.com
Subject: Re: query produces 1 GB temp file
Date: Sun, 06 Feb 2005 17:12:19 +0100
Message-ID: <420641E3.10505@aeccom.com> (raw)
In-Reply-To: <876515k7er.fsf@stark.xeocode.com>
References: <20050205182117.0125074@mail2.aeccom.com>
	<87y8e2kb8j.fsf@stark.xeocode.com>
	<42061B35.6000306@aeccom.com>
	<876515k7er.fsf@stark.xeocode.com>

Greg Stark wrote:

>I gave a bunch of "explain analyze select" commands to test estimates for
>individual columns. What results do they come up with? If those are inaccurate
>then raising the statistics target is a good route. If those are accurate
>individually but the combination is inaccurate then you have a more difficult
>problem.
>
>  
>
After  setting the new statistics target to 200 they did slightly better 
but not accurate. The results were attached to my last post. Here is a copy:



explain analyze select * from bi where rc=130170467;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------- 

Seq Scan on bi (cost=0.00..41078.76 rows=190960 width=53) (actual 
time=0.157..3066.028 rows=513724 loops=1)
Filter: (rc = 130170467::oid)
Total runtime: 4208.663 ms
(3 rows)


explain analyze select * from bi where co=117305223;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------- 

Seq Scan on bi (cost=0.00..41078.76 rows=603988 width=53) (actual 
time=0.021..3692.238 rows=945487 loops=1)
Filter: (co = 117305223::oid)
Total runtime: 5786.268 ms
(3 rows)

Here is the distribution of the data in bi:
select count(*) from bi;

 1841966


select count(*) from bi where rc=130170467::oid;

 513732


select count(*) from bi where co=117305223::oid;

 945503







view thread (24+ messages)  latest in thread

Message-ID: <420641E3.10505@aeccom.com>
Permalink:  ../420641E3.10505@aeccom.com/
Also on:    postgresql.org/message-id/420641E3.10505@aeccom.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: Dirk.Lutzebaeck@t-online.de, gsstark@mit.edu, tgl@sss.pgh.pa.us, john@arbash-meinel.com
  Subject: Re: query produces 1 GB temp file
  In-Reply-To: <420641E3.10505@aeccom.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