pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nis Jørgensen <nis@superlativ.dk>
To: pgsql-performance@postgresql.org
Subject: Re: How to improve speed of 3 table join &group (HUGE tables)
Date: Tue, 23 Oct 2007 13:16:46 +0200
Message-ID: <ffkl74$tik$1@ger.gmane.org> (raw)
In-Reply-To: <4717B80B.6050706@cbio.mskcc.org>
References: <4717914D.1050704@cbio.mskcc.org>
	<ff8ace$t7e$1@ger.gmane.org>
	<4717B80B.6050706@cbio.mskcc.org>

John Major skrev:
> Hello Nis-
> 
> I did reset the defaults before running the explain.

This line from your original post:

->  Seq Scan on sequence_alignment sa  (cost=100000000.00..110379294.60
rows=467042560 width=4)

Is an indication that you didn't (AFAIK enable_seqscan=off works by
setting the cost of starting a seqscan to 100000000).

> Candidate keys.
>  fragment_external_info.seq_frag_id (FK to sequence_fragment.seq_frag_id)
>  sequence_alignment.sequence_id (FK to sequence_fragment.sequence_id). 

Those are not candidate keys. A candidate key is "something which could
have been chosen as the primary key". Anyway, I think I understand your
table layout now. It might have been quicker if you just posted the
definition of your tables. This could also have shown us that the
correct indexes are in place, rather than taking your word for it.

You are absolutely certain that both sides of all FK relationships are
indexed?

> After  making the 2 changes, the cost dropped dramatically... but is still very high.
> Original Explain cost:
> cost=1308049564..1345206293 rows=54 width=16
> 
> New Explain cost:
> cost=11831119..11831120 rows=54 width=16 

Please post the full output if you want more help. And preferably use
EXPLAIN ANALYZE, now that it runs in finite time.


Nis




view thread (7+ messages)

Message-ID: <ffkl74$tik$1@ger.gmane.org>
Permalink:  ../ffkl74$tik$1@ger.gmane.org/
Also on:    postgresql.org/message-id/ffkl74$tik$1@ger.gmane.org

 · 

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: nis@superlativ.dk
  Subject: Re: How to improve speed of 3 table join &group (HUGE tables)
  In-Reply-To: <ffkl74$tik$1@ger.gmane.org>

* 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