Re: Optimizing Query - Mailing list pgsql-sql

From Justin Long
Subject Re: Optimizing Query
Date
Msg-id 5.0.2.1.0.20010305165854.03114e48@mail.strategicnetwork.org
Whole thread Raw
In response to Re: Optimizing Query  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Optimizing Query  (Michael Fork <mfork@toledolink.com>)
Re: Optimizing Query  (Mathijs Brands <mathijs@ilse.nl>)
Re: Optimizing Query  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Ok, now I have another question... it doesn't seem to be accessing the index.<br /><br /> explain select
k.kbid,k.titlefrom knowledge k , kbwords w0 , kbwords w1 WHERE ((k.kbid=w0.kbid and w0.wordid=42743) AND
(k.kbid=w1.kbidand w1.wordid=85369))<br /><br /> NOTICE:  QUERY PLAN:<br /><br /> Merge Join  (cost=32339.30..35496.97
rows=19262538width=24)<br />   ->  Merge Join  (cost=16530.24..16668.77 rows=233274 width=20)<br />         -> 
Sort (cost=15809.06..15809.06 rows=8257 width=4)<br />               ->  Seq Scan on kbwords w1 
(cost=0.00..15271.85rows=8257 width=4)<br />         ->  Sort  (cost=721.18..721.18 rows=2825 width=16)<br />
             ->  Seq Scan on knowledge k  (cost=0.00..559.25 rows=2825 width=16)<br />   ->  Sort 
(cost=15809.06..15809.06rows=8257 width=4)<br />         ->  Seq Scan on kbwords w0  (cost=0.00..15271.85 rows=8257
width=4)<br/><br /> Note the sequential scans... there is a wordindex where w0.wordid=42743... why isn't it doing an
indexscan?wouldn't that be more efficient?<br /><br /> Justin<br /><br /><br /> At 04:45 PM 3/5/2001 -0500, you
wrote:<br/><blockquote cite="cite" class="cite" type="cite">Yes.<br /><br /> > On Mon, Mar 05, 2001 at 04:07:57PM
-0500,Bruce Momjian allegedly wrote:<br /> > > Have you tried VACUUM ANALYZE and CLUSTER?<br /> > <br /> >
Iassume CLUSTER still drops all indexes except the one you're clustering<br /> > on?<br /> > <br /> >
Mathijs<br/> > -- <br /> > It's not that perl programmers are idiots, it's that the language<br /> > rewards
idioticbehavior in a way that no other language or tool has<br /> > ever done.<br />
>                                                    Erik Naggum<br /> > <br /><br /><br /> -- <br />   Bruce
Momjian                       |  <a eudora="autourl" href="http://candle.pha.pa.us/">http://candle.pha.pa.us</a><br />
 pgman@candle.pha.pa.us               |  (610) 853-3000<br />   +  If your life is a hard drive,     |  830 Blythe
Avenue<br/>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026</blockquote><p><font
face="CourierNew, Courier"><br /> ____________________________________________________________________<br /> Justin
Long                                     Networkfor Strategic Missions<br /> justinlong@strategicnetwork.org 1732 South
ParkCourt<br /><a eudora="autourl"
href="http://www.strategicnetwork.org/">http://www.strategicnetwork.org</a> Chesapeake,VA 23320, USA<br /> Reality
Checke-zine: reality-check-subscribe@yahoogroups.com<br />
____________________________________________________________________<br/> Law: Never retreat. Never surrender. Never
cuta deal with a dragon.<br /> Corollary: No armor? Unclean life? Then do not mess in the affairs <br /> of dragons,
foryou are crunchy and taste good with ketchup.<br /></font> 

pgsql-sql by date:

Previous
From: Mathijs Brands
Date:
Subject: Re: How do I use text script containing SQL?
Next
From: Mathijs Brands
Date:
Subject: Clustering (was Re: Optimizing Query)