pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Brice Ruth <brice@webprojkt.com>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Query never returns ...
Date: Thu, 08 Feb 2001 11:06:49 -0600
Message-ID: <3A82D229.F7ACA021@webprojkt.com> (raw)
References: <Pine.BSF.4.21.0102080855120.54197-100000@megazone23.bigpanda.com>

All right ... after reading up on the documentation for vacuum, I
understand why that's necessary.  I've run vacuum analyze on all the
tables, now.  Here are the more realistic results from explain:

NOTICE:  QUERY PLAN:

Sort  (cost=62.46..62.46 rows=14 width=64)
  ->  Nested Loop  (cost=0.00..62.19 rows=14 width=64)
        ->  Index Scan using pk_tblsidedruglink on tblsidedruglink 
(cost=0.00..33.82 rows=14 width=28)
        ->  Index Scan using pk_tblmedcond on tblmedcond 
(cost=0.00..2.01 rows=1 width=36)

The query runs lightning fast now ... THANK YOU!!! :)

-Brice

Stephan Szabo wrote:
> 
> After you load the data, you need to run vacuum analzye.  That'll
> get statistics on the current data in the table.  Of course, I'm
> not sure that'll help in this case.
> 
> On Thu, 8 Feb 2001, Brice Ruth wrote:
> 
> > Stephan,
> >
> > Here is what EXPLAIN shows:
> >
> > NOTICE:  QUERY PLAN:
> >
> > Sort  (cost=0.02..0.02 rows=1 width=64)
> >   ->  Nested Loop  (cost=0.00..0.01 rows=1 width=64)
> >         ->  Seq Scan on tblmedcond  (cost=0.00..0.00 rows=1 width=36)
> >         ->  Seq Scan on tblsidedruglink  (cost=0.00..0.00 rows=1 width=28)
> >
> > As for vacuum analyze - prior to running into these problems, I deleted
> > all data from the database (using delete from <tblname>) and then ran
> > vacuumdb -a, after which I loaded the data into the tables using 'copy
> > ... from' - there have been no updates to the database since then -
> > merely selects.

-- 
Brice Ruth
WebProjkt, Inc.
VP, Director of Internet Technology
http://www.webprojkt.com/



view thread (12+ messages)  latest in thread

Message-ID: <3A82D229.F7ACA021@webprojkt.com>
Permalink:  ../3A82D229.F7ACA021@webprojkt.com/
Also on:    postgresql.org/message-id/3A82D229.F7ACA021@webprojkt.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 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-sql@postgresql.org
  Cc: brice@webprojkt.com, sszabo@megazone23.bigpanda.com, pgsql-general@postgresql.org
  Subject: Re: [SQL] Query never returns ...
  In-Reply-To: <3A82D229.F7ACA021@webprojkt.com>
  References: <Pine.BSF.4.21.0102080855120.54197-100000@megazone23.bigpanda.com> <3A82D229.F7ACA021@webprojkt.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