Re: Avoiding a seq scan on a table. - Mailing list pgsql-novice

From LWATCDR
Subject Re: Avoiding a seq scan on a table.
Date
Msg-id 8c38cea40801140914m41328019i33b37d652478b8b0@mail.gmail.com
Whole thread Raw
In response to Re: Avoiding a seq scan on a table.  ("Sean Davis" <sdavis2@mail.nih.gov>)
Responses Re: Avoiding a seq scan on a table.  ("Daniel T. Staal" <DStaal@usa.net>)
Re: Avoiding a seq scan on a table.  ("Sean Davis" <sdavis2@mail.nih.gov>)
Re: Avoiding a seq scan on a table.  (Alan Hodgson <ahodgson@simkin.ca>)
Re: Avoiding a seq scan on a table.  (Brian Hurt <bhurt@janestcapital.com>)
Re: Avoiding a seq scan on a table.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Really? From what I have done in writing my own code I have found
hashing to be faster than a btree but then when I wrote my own hashing
it was a specific type of key.
Anyway I put in the tree indexes and I am still getting a seq scan.

Aggregate  (cost=12.12..12.13 rows=1 width=0)
  ->  Result  (cost=0.00..12.12 rows=1 width=0)
        One-Time Filter: NULL::boolean
        ->  Seq Scan on issuetracking  (cost=0.00..12.12 rows=1 width=0)
              Filter: (((issue_target)::text = 'david'::text) OR
((manager)::text = 'david'::text))


On Jan 14, 2008 11:54 AM, Sean Davis <sdavis2@mail.nih.gov> wrote:
>
>
>
> On Jan 14, 2008 11:45 AM, LWATCDR <lwatcdr@gmail.com> wrote:
> > Thanks would you suggest a btree or a hash? My guess would a hash
> > since it uses an =.
> >
>
> You can pretty much ignore hash indexes in Postgres.  They are, in nearly
> every case (every case that I know of), slower than btree.  Just make the
> indexes using the default indexing scheme.  Again, do not forget to analyze
> the table after creating the indexes.
>
> Sean
>
>
>

pgsql-novice by date:

Previous
From: Brian Hurt
Date:
Subject: Re: Avoiding a seq scan on a table.
Next
From: "Daniel T. Staal"
Date:
Subject: Re: Avoiding a seq scan on a table.