Re: trouble with (lack of) indexing - Mailing list pgsql-general

From Tom Lane
Subject Re: trouble with (lack of) indexing
Date
Msg-id 24348.1020987486@sss.pgh.pa.us
Whole thread Raw
In response to Re: trouble with (lack of) indexing  (Søren Boll Overgaard <postgres@fork.dk>)
Responses Re: trouble with (lack of) indexing
Re: trouble with (lack of) indexing
Re: trouble with (lack of) indexing
List pgsql-general
=?iso-8859-1?Q?S=F8ren?= Boll Overgaard <postgres@fork.dk> writes:
>  explain SELECT ht.id,hq.ip,hq.id FROM
>  hostsqueue as hq,hoststests as ht WHERE  ht.hostsqueue_id=hq.id;
> NOTICE:  QUERY PLAN:

> Hash Join  (cost=776.05..2904.36 rows=84 width=24)
>   ->  Seq Scan on hoststests ht  (cost=0.00..2126.84 rows=84 width=8)
>   ->  Hash  (cost=776.04..776.04 rows=4 width=16)
>         ->  Seq Scan on hostsqueue hq  (cost=0.00..776.04 rows=4 width=16)


If there's only 84 rows it's hardly going to matter which plan we choose
;-).  Please show us the results from the production database, not the
toy-sized tables.

If you have 7.2 then EXPLAIN ANALYZE is much more useful to show than
plain EXPLAIN.  Also, you could try doing "SET enable_seqscan = off"
and see how the plan changes.

            regards, tom lane

pgsql-general by date:

Previous
From: Søren Boll Overgaard
Date:
Subject: Re: trouble with (lack of) indexing
Next
From: "Nigel J. Andrews"
Date:
Subject: Re: Quick SQL question . . .