Re: Avoiding a seq scan on a table.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: LWATCDR <lwatcdr(at)gmail(dot)com>
Cc: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Avoiding a seq scan on a table.
Date: 2008-01-14 19:06:58
Message-ID: 23234.1200337618@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

LWATCDR <lwatcdr(at)gmail(dot)com> writes:
> 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))

You should worry about making the query correct before you worry about
making it fast. That constant false one-time filter is a red flag...
looks like you forgot the difference between "IS NULL" and "= NULL".

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message LWATCDR 2008-01-14 19:31:13 Re: Avoiding a seq scan on a table.
Previous Message Daniel T. Staal 2008-01-14 17:55:58 Re: Avoiding a seq scan on a table.