pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Beaver <john.e.beaver@gmail.com>
Cc: Pgsql-Performance <pgsql-performance@postgresql.org>
Subject: Re: sequence scan problem
Date: Sun, 29 Jun 2008 23:31:35 -0400
Message-ID: <10566.1214796695@sss.pgh.pa.us> (raw)
In-Reply-To: <48680418.7030708@gmail.com>
References: <48680418.7030708@gmail.com>

John Beaver <john.e.beaver@gmail.com> writes:
> Can anyone explain this? There should only ever be a maximum of about 50 
> rows returned when the query is executed.

Is the estimate that 197899 rows of gene_prediction_view have
go_term_ref = 2 about right?  If not, then we need to talk about
fixing your statistics.  If it is in the right ballpark then I do
not see *any* plan for this query that runs in small time.
The only way to avoid a seqscan on functional_linkage_scores would
be to do 198K^2 index probes into it, one for each combination of
matching fs1 and fs2 rows; I can guarantee you that that's not a win.

The fact that the planner is estimating 352770803726 result rows
compared to your estimate of 50 offers some hope that it's a stats
problem, but ...

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <10566.1214796695@sss.pgh.pa.us>
Permalink:  ../10566.1214796695@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10566.1214796695@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, john.e.beaver@gmail.com
  Subject: Re: sequence scan problem
  In-Reply-To: <10566.1214796695@sss.pgh.pa.us>
  References: <48680418.7030708@gmail.com> <10566.1214796695@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